Re: [sqlite] multiple updates

2008-05-06 Thread David Bicking
f <[EMAIL PROTECTED]> > Subject: [sqlite] multiple updates > To: sqlite-users@sqlite.org > Date: Tuesday, May 6, 2008, 4:26 PM > Is there a way of doing that in one single shot : > UPDATE Contacts SET Age = 30 WHERE ID = 1; UPDATE Contacts > SET Age = 30 > WHERE ID = 2; U

Re: [sqlite] multiple updates

2008-05-06 Thread Jay A. Kreibich
On Tue, May 06, 2008 at 04:26:55PM -0400, cedric tuboeuf scratched on the wall: > Is there a way of doing that in one single shot : > UPDATE Contacts SET Age = 30 WHERE ID = 1; UPDATE Contacts SET Age = 30 > WHERE ID = 2; UPDATE Contacts SET Age = 20 WHERE ID = 3; UPDATE Contacts SET > Age = 10

Re: [sqlite] multiple updates

2008-05-06 Thread P Kishor
On 5/6/08, cedric tuboeuf <[EMAIL PROTECTED]> wrote: > Is there a way of doing that in one single shot : > UPDATE Contacts SET Age = 30 WHERE ID = 1; UPDATE Contacts SET Age = 30 > WHERE ID = 2; UPDATE Contacts SET Age = 20 WHERE ID = 3; UPDATE Contacts SET > Age = 10 WHERE ID = 4; > > I knwo

[sqlite] multiple updates

2008-05-06 Thread cedric tuboeuf
Is there a way of doing that in one single shot : UPDATE Contacts SET Age = 30 WHERE ID = 1; UPDATE Contacts SET Age = 30 WHERE ID = 2; UPDATE Contacts SET Age = 20 WHERE ID = 3; UPDATE Contacts SET Age = 10 WHERE ID = 4; I knwo I can process one a the time, but I would like to know why my query

Re: [sqlite] Multiple Updates

2006-09-29 Thread Dennis Cote
Trevor Talbot wrote: Just prepare/step a BEGIN before the loop, and a COMMIT afterward. Or even more simply, use sqlite3_exec(). It works very well for everything except queries. It already contains all the code to prepare the statement and execute it using sqlite3_prepare and

Re: [sqlite] Multiple Updates

2006-09-29 Thread Chris Gurtler
Hi Trevor, Thanks, that makes a big difference to the way I thought it worked. Regards, Chris Trevor Talbot wrote: On 9/29/06, Chris Gurtler <[EMAIL PROTECTED]> wrote: A transaction has the select statements in one single string starting with a begin and ending with an end. I have a

Re: [sqlite] Multiple Updates

2006-09-29 Thread Trevor Talbot
On 9/29/06, Chris Gurtler <[EMAIL PROTECTED]> wrote: A transaction has the select statements in one single string starting with a begin and ending with an end. I have a column which is a BLOB, and this may contain control characters like NULL. Think of BEGIN and COMMIT more like

Re: [sqlite] Multiple Updates

2006-09-29 Thread Chris Gurtler
Hi Trevor, A transaction has the select statements in one single string starting with a begin and ending with an end. I have a column which is a BLOB, and this may contain control characters like NULL. Regards, Chris Trevor Talbot wrote: On 9/28/06, Chris Gurtler <[EMAIL PROTECTED]>

Re: [sqlite] Multiple Updates

2006-09-28 Thread Trevor Talbot
On 9/28/06, Chris Gurtler <[EMAIL PROTECTED]> wrote: I wish I could use transactions, but because I'm updating a blob I need to do it that way. Ill check out the PRAGMA option to see if that helps. Why does what you showed above mean you can't use transactions? Also, that PRAGMA will mean a

Re: [sqlite] Multiple Updates

2006-09-28 Thread Chris Gurtler
Thanks, I wish I could use transactions, but because I'm updating a blob I need to do it that way. Ill check out the PRAGMA option to see if that helps. Regards, Chris He Shiming wrote: Hi All, Is it possible to do multiple updates of blobs using the bind variables, I was doing them 1

Re: [sqlite] Multiple Updates

2006-09-28 Thread He Shiming
Hi All, Is it possible to do multiple updates of blobs using the bind variables, I was doing them 1 at a time but it was a little slow. For example :- rc = sqlite3_prepare(objects_db, "UPDATE table SET proprietary_data = ? WHERE device_id = ? and instance = ?", -1, , 0); for (i= 0; i