|
Re: Emulating a sequence: msg#00025python.db.pysqlite.user
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. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Emulating a sequence: 00025, ggivler-zdgUFu1MqnQ |
|---|---|
| Next by Date: | Re: Emulating a sequence: 00025, Gerhard Häring |
| Previous by Thread: | Re: Emulating a sequencei: 00025, ggivler-zdgUFu1MqnQ |
| Next by Thread: | Re: Emulating a sequence: 00025, Gerhard Häring |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |