var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Batch Insert Issue with Mysql
I am a newbie to this community and am quite impressed by the discussions carried out.
So, I just thought this would be the right place to ask SQL doubts although the problem is with MySQL.
My problem is:
I need to insert thousands of records in 2 tables A, B.
Now table A has a column index_no, an auto-incrementing column.
When I insert any row in table A, I want that the row in table B should be inserted using the index_no in table A.
One approach that I am using is,
Insert a record in table A, get the Index_No value and insert the record in table B with this index_No.
However for every set of records, there are 3 queries being executed -- insert in A,select from A and insert in B.
For 10000 records, this figure is 10000*3 = 30000.
Is there any better way to do it. (like LOAD LOCAL DATA in FILE)
you can use a ETL.
for example pentaho.
Pentaho BI Suite 3.5 will help you escape proprietary BI!
in tools you have function for auto increment, and you can insert in few tables one columns or whole record.