23 Feb 2011 12:30
Perl script to insert data in mysql from Excel file
francesca casalino <francy.casalino <at> gmail.com>
2011-02-23 11:30:05 GMT
2011-02-23 11:30:05 GMT
Hi everybody, I am a real newbie in both perl and relational databases like mysql, and I have been banging my head on the wall trying to understand how to populate a mysql database using an Excel file (.csv). I constructed a my sql database (called “test”), set up the DBD::mysql module, read a book on perl, but I still cannot figure out how to approach this problem, so I resort to the experts…Could you please help me understand how to approach this? The database on mysql has tables where each one is related to the other through foreign keys, so for example table_2 is: CREATE TABLE table_2 ( table_2_id int(10) unsigned NOT NULL AUTO_INCREMENT, table_1_id int(10) NOT NULL, binary_assign varchar(10) NOT NULL, reference tinyint(1) NOT NULL, PRIMARY KEY (table_2_id), ); Now, my Excel file has 4 fields, with the first 2 fields that should go into the table_1, and the next two columns that should BOTH go into table_2(Continue reading)
RSS Feed