As part of a migration activity i need to load a table in mysql with data from two different input files. As in few fields in the table are loaded from one input file and rest from another. Also the input files are not order wise,what i mean is field 1 in input file 1 might not be the first field in the table. So data needs to be loaded into proper fields in the table from input files.
Hope my question is clear. If anyone can suggest any scripts or anything for this would be helpful
Thanks in advance.
Mysql – Loading a table with input from two different input files
MySQL
Related Question
- Mysql – How to update cust_id from Customer table to order table Cust_id field while inserting customer name using trigger
- MySQL Error when importing CSV with empty fields
- Mysql – How to restore database with ib_log0, ib_log1 and ibdata1 files in MySQL
- Mysql – Fast data loading with duplicate check
- MySQL – Order of Table Load From Backup
Best Answer
Create a table (t1) with columns matching the columns of one file. Load that file into it.
Create another table (t2) with columns matching the columns of the other file. Load that file into it.
Now create the main table (if it does not already exist). Load it with something like