|
Re: Emulating a sequence: msg#00029python.db.pysqlite.user
cursor.execute(stmt, tuple) or executemany is what I use. To tell the truth I have never used executescript. Thanks, Greg Givler Information Technology Lockwood® 10 Valley Stream Parkway Malvern, PA 19355 Phone: (484) 605-4826 Email: ggivler-zdgUFu1MqnQ@xxxxxxxxxxxxxxxx David Pratt <fairwinds@eastli To: ggivler-zdgUFu1MqnQ@xxxxxxxxxxxxxxxx nk.ca> cc: pysqlite-Y+ulVh6ByXJeoWH0uzbU5w@xxxxxxxxxxxxxxxxxxxxx Subject: Re: [pysqlite] Emulating a sequence 05/03/2006 12:55 PM Hi Greg. I tried this before quoting. Here is what I had done and the error. Can you spot the problem? This is what I had tried: stmt = """ update sequence set commit_seq = commit_seq + 1 where id=1; insert into ztransaction ( tid, commit_order, username, description, extension) values (?, (select commit_seq from sequence where id=1), ?, ?, ?); """ cursor.executescript(stmt, (tid_int, user, desc, ext)) The error: cursor.executescript(stmt, (tid_int, user, desc, ext)) TypeError: function takes exactly 1 argument (2 given) Regards, David ggivler-zdgUFu1MqnQ@xxxxxxxxxxxxxxxx wrote: > Replace your %s with ? and things should work... > > It will handle the quotes and stuff for you. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please call the help desk at ext 4850 ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Emulating a sequence: 00029, Gerhard Häring |
|---|---|
| Next by Date: | Re: Emulating a sequence: 00029, David Pratt |
| Previous by Thread: | Re: Emulating a sequencei: 00029, Gerhard Häring |
| Next by Thread: | Re: Emulating a sequence: 00029, David Pratt |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |