|
Re: Emulating a sequence: msg#00026python.db.pysqlite.user
David Pratt wrote: > Hi Greg. I tried this before quoting. Here is what I had done and the > error. Can you spot the problem? > [...] > The error: > cursor.executescript(stmt, (tid_int, user, desc, ext)) > TypeError: function takes exactly 1 argument (2 given) executescript only accepts a single parameter, a SQL script text. You don't need to use executescript for executing stuff within a single transaction. Simply use two executes on the cursor object and the commit on the connection object: con = sqlite.connect(...) cur = con.cursor() cur.execute(...) # <-- if a DML like INSERT, UPDATE, ... does a "BEGIN" cur.execute(...) con.commit() # COMMIT the transaction -- Gerhard |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Emulating a sequence: 00026, David Pratt |
|---|---|
| Next by Date: | Re: Installation problem around sqlite3.h: 00026, Geoff Gardiner |
| Previous by Thread: | Re: Emulating a sequencei: 00026, David Pratt |
| Next by Thread: | Re: Emulating a sequence: 00026, ggivler-zdgUFu1MqnQ |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |