> 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
Kent, Yesss!!
That did the trick! It's worth to remeber.
Thank you very much!
Aivars
2008/11/7 Kent Johnson <[EMAIL PROTECTED]>:
> On Fri, Nov 7, 2008 at 3:49 AM, aivars <[EMAIL PROTECTED]> wrote:
>
>> import sqlite3
>>
>> sPath=r'e:\pythonexamples\aivars2.db'
>>
>> con=sqlite3.connect(sPath)
On Fri, Nov 7, 2008 at 3:49 AM, aivars <[EMAIL PROTECTED]> wrote:
> import sqlite3
>
> sPath=r'e:\pythonexamples\aivars2.db'
>
> con=sqlite3.connect(sPath)
> cur=con.cursor()
> cur.execute("insert into test (name) values (?)",sPath)
The second argument to execute() is a *sequence* of parameter va
Thanks, Alan,
here is a create statement:
CREATE TABLE "test" ("name" TEXT)
And also I would like to thank you for you web page. Classes and OOP
seems to start to make sense to me now slowly after I am reading your
material.
Aivars
2008/11/7 Alan Gauld <[EMAIL PROTECTED]>:
>
> "aivars" <[EMAI
"aivars" <[EMAIL PROTECTED]> wrote
sPath=r'e:\pythonexamples\aivars2.db'
con=sqlite3.connect(sPath)
cur=con.cursor()
cur.execute("insert into test (name) values (?)",sPath)
con.commit()
File "E:\PythonExamples\test.py", line 7, in
cur.execute("insert into test (name) values (?)",sPath)
Hello,
I am getting frustrated.
I have been successfully inserting, deleting, etc records with python
and sqlite no problem.
Suddenly the following very simple scrip does not work:
import sqlite3
sPath=r'e:\pythonexamples\aivars2.db'
con=sqlite3.connect(sPath)
cur=con.cursor()
cur.execute("ins