On 5/26/16, Eric Grange <zar...@gmail.com> wrote:
>
> I am looking for the fastest way to insert many rows to a simple table.

(1) Create a prepared statement:  "INSERT INTO xyzzy VALUES(?1,?2,...)"
(2) Run "BEGIN"
(3) Loop over each row you want to insert, bind values to the prepared
statement, then call sqlite3_step() and sqlite3_reset().
(4) Run "COMMIT"
(5) Call sqlite3_finalize() on the prepared statement to avoid a memory leak.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to