#1 2013-08-02 13:45:37

KJames
Member
Registered: 2013-07-02
Posts: 15

Getting ID from Batch Insert

I need to use a Batch Insert method (there are a lot of records), but after the insertion in the database,  I need to get all the IDs of the inserted records.
How can I do that?

Offline

#2 2013-08-02 13:49:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: Getting ID from Batch Insert

Use BatchStart
  + BatchAdd() in a loop
  + BatchSend() which returns the IDs in its parameter variable.

See http://blog.synopse.info/post/2011/06/0 … ng-records
and the latest revsion 1.18 Of the SAD pdf.

Do not forget to use a transaction for SQlite3.

Offline

#3 2013-08-02 18:05:00

KJames
Member
Registered: 2013-07-02
Posts: 15

Re: Getting ID from Batch Insert

Once again you are right and helped me to solve my doubt.

Thank you very much!!! smile

Offline

Board footer

Powered by FluxBB