Dion,

Let me repeat back to you the question that I heard you asking:

Can I load a text-file representation of a big, flat, single-table 
unnormalized mess into a nicely normalized multi-table MySQL database all 
in one fell swoop?

The answer I thought I heard from Bhavinder(?) Vyas was No, you have to 
produce normalized flat files and load them in one by one.

My answer is, No, you have to load the whole big unnormalized mess into a 
temporary table and pull it apart programmatically.

Perhaps I'm reading too much into throwaway remarks, but your phrase "from 
multiple sources" seemed pregnant with hidden meaning.  I.e., "Some genius 
in the Peoria office (for example) came up with this spreadsheet and passed 
it around to all the other branch offices, and it got totally out of hand, 
so some other genius has consolidated it all into a flat file, and now it's 
up to me to turn it into useful data."

In that case, you should read deeply into my off-hand remark, 
"programmatically."  Save your code.  By the time you get this all working 
correctly, they'll have a second batch.

You may need some management help in setting everyone's expectations 
appropriately.

Hope this helps.

--Erv

At 10:12 AM 6/7/2002 -0500, Dion Wickander wrote:
>I am working on a project were the customer info will be uploaded to a MySQL
>database from multiple sources with a customer ID already assigned to them
>and this data needs to be related to other tables with related info. OK I
>have an auto increment column set up as the primary key to keep track of the
>customer records that are being created and using it to relate the data to
>my other tables.
>
>here is the question....
>
>is their a built in or automated way to load data in bulk to the customer
>table and with each record added to that table create a record in the other
>related tables with the correct primary key? or would this need to be a
>record by record individual insert to create the corresponding records.
>
>- my thinking is that I may have to load data in bulk, setting a flag for
>the newly uploaded data. Then do a select that finds the flags and then
>creating the new records in the related tables based on the found set. then
>of course removing the flags after all other tables are updated.
>
>I was just wondering if their is a built in mechanism for something like
>this?
>
>thanks in advance.
>
>
>MySQL 3.23.39
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to