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)
>> cur=con.cursor()
>> cur.execute("insert into test (name) values (?)",sPath)
>
> The second argument to execute() is a *sequence* of parameter values.
> A string is a sequence of characters, so by passing a plain string you
> are saying that each character of the string is a parameter to the
> SQL.
>
> Try adding braces around the parameter to make  list:
> cur.execute("insert into test (name) values (?)", [sPath])
>
> Kent
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to