Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009

    Unanswered: Batch Insert Issue with Mysql

    Hello everyone,

    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)


  2. #2
    Join Date
    Nov 2009
    Any help?????

  3. #3
    Join Date
    Sep 2009
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts