[Tutor] problem with simple sqlite script

ALAN GAULD alan.gauld at btinternet.com
Sat Nov 8 00:10:50 CET 2008



> CREATE TABLE "test" ("name" TEXT)


OK, That looks fine.

>> con=sqlite3.connect(sPath)
>> cur=con.cursor()
>> cur.execute("insert into test (name) values (?)",sPath)


Try putting the string variable in a tuple:

cur.execute("insert into test (name) values (?)", (sPath,) )


That seems to work for me...

HTH,

Alan G.


More information about the Tutor mailing list