begin;
insert into table (col1,col2) values (val1,val2);
insert into table (col1,col2) values (val3,val4);
insert into table (col1,col2) values (val5,val6);
end;
you might use FOR or WHILE to construct the query
another example
sqlite_exec($db,"BEGIN;");
for($x = 1; $x<=50; $x++) {
sqlite_exec($db,"INSERT INTO Hits VALUES ('reports.php5', 'jim')");
}
sqlite_exec($db,"END;");
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "General Discussion of SQLite Database"
<[email protected]>
Sent: Monday, August 11, 2008 4:13 PM
Subject: Re: [sqlite] multiple inserts
>
> On Mon, 11 Aug 2008, P Kishor wrote:
>
>> On 8/11/08, Kodok Mrton <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> Does SQLite accepts multiple insert?
>>> insert into table (col1,col2) values (val1,val2), (val3,val4),
>>> (val5,val6)
>>>
>>> If not, how can I speed up large inserts?
>>> eg: 1000 rows
>>
>> one word... transactions
>
> Can you give an example of how to use transactions to accomplish this
> specific case?
>
> Chris
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Christopher F. Martin
> School of Medicine
> Center for Digestive Diseases & Nutrition
> CB# 7555, 4104 Bioinformatics Bldg.
> University of North Carolina at Chapel Hill
> Chapel Hill, North Carolina 27599-7555
> Phone: 919.966.9340 Fax: 919.966.7592
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
>>
>>
>>>
>>> Regards,
>>> Marton
>>> _______________________________________________
>>> sqlite-users mailing list
>>> [email protected]
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>
>>
>> --
>> Puneet Kishor http://punkish.eidesis.org/
>> Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
>> Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
>> _______________________________________________
>> 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