Thomas Dybdahl Ahle wrote:
Hi, I'm running a project using pysqlite for database support. It's
awsome.
Now I have a user who produces this warning: "Warning: You can only
execute one statement at a time."

Hard to say without knowing the value of sql in
cur.execute(sql)

pysqlite's execute method can only execute a single query. Use executescript to executing multiple queries.

I'm wondering if it can have something to do with multiple processes
using the same database?

Don't think so.

I can't reproduce it my self, but then I haven't got a dural core
processor.

I'm running a dual CPU machine and with Python2.5 and sqlite3 (basically what you have but newer) I get:


PythonWin 2.5 (r25:51908, ... v.1310 32 bit (Intel)] on win32.
Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> import sqlite3
>>> C=sqlite3.Connection(":memory:")
>>> c=C.cursor()
>>> c.execute("begin; create table t(a); end")
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
Warning: You can only execute one statement at a time.

>>> c.executescript("begin; create table t(a); end")
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
ProgrammingError: you did not provide a complete SQL statement

>>> c.executescript("begin; create table t(a); end;")
<sqlite3.Cursor object at 0x00D80A70>

BTW, there is a pysqlite list (this one is for the SQLite, the underlying C library) but it's a bit quiet.

Martin

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to