Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-30 Thread Alaric Snell-Pym
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/30/2011 03:41 PM, Pavel Ivanov wrote: >> 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,

Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-30 Thread Pavel Ivanov
> 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,

Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-29 Thread Sreekumar TP
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 wrote: > Sreekumar, > > Regarding: > > > > Is it possible to insert multiple rows using a

Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-29 Thread Donald Griggs
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

Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-29 Thread Petite Abeille
On Nov 29, 2011, at 10:47 AM, Darren Duncan wrote: >> Is it possible to insert multiple rows using a single statement ? > > Yes. > > INSERT INTO foo (x, y) > VALUES (1,2), (3,4), (5,6),...; I don't think this syntax is supported by SQLite: http://www.sqlite.org/lang_insert.html > > INSERT

Re: [sqlite] Inserting Multiple Rows in a single statement

2011-11-29 Thread Darren Duncan
Sreekumar TP wrote: Is it possible to insert multiple rows using a single statement ? Yes. INSERT INTO foo (x, y) VALUES (1,2), (3,4), (5,6),...; INSERT INTO foo (x,y) SELECT x, y FROM bar; That's at least 2 ways. -- Darren Duncan ___