> I do have multiple insertions bounded by BEGIN-COMMIT . I am looking at
> possibilities of making the insertions faster.

Prepare your statement in the form

INSERT INTO table_name (val1, val2, ...) VALUES (?1, ?2, ...)

Then for each row you want to insert you will bind necessary values,
execute statement and reset. With all that wrapped in transaction
there's no way to make insertions any faster. Even if SQLite supported
the multi-row insert syntax it would do exactly the same operations -
bind values, insert row, reset, bind values, insert row, reset.


Pavel


On Wed, Nov 30, 2011 at 2:52 AM, Sreekumar TP <[email protected]> wrote:
> Hi,
>
> I do have multiple insertions bounded by BEGIN-COMMIT . I am looking at
> possibilities of making the insertions faster.
>
> -Sreekumar
>
> On Tue, Nov 29, 2011 at 4:36 PM, Donald Griggs <[email protected]> wrote:
>
>> Sreekumar,
>>
>> Regarding:
>> >
>> > Is it possible to insert multiple rows using a single statement ?
>> >
>>
>> You might want to let us know your reasons for requesting this.
>>
>> If it's speed of insertion you're after, then be sure to put many INSERT's
>> into each transaction. That is, be sure to surround a batch of, say, 1000
>> INSERT's with BEGIN and END statements.
>>
>> http://sqlite.org/lang_transaction.html
>>  _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to