
December 3rd, 2003, 11:45 AM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 35
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
I've never used Python w/ MySQL before, but I have used Python to load an Oracle database (using cx_Oracle). The process was pretty simple-- if you've got a text file that contains values that correspond to keys from other tables, just write the code that does a select to retrieve the values from the table befre you do your insert. Python was quick enough to populate the oracle database with tens of thousands of records (one table had 19,000 records alone) in a reasonable amount of time (15 minutes IIRC?).
If you don't want to do the data lookups individually, you can just do a select * from the table(s) that have the data you'll be using, put that data into a dictionary, and then do lookups on the dictionary as you need to (mydict[key_from_text_file]).
|