[pysqlite] [APSW 3.6.5-r1] Why does this INSERT fail?
Fred <[email protected]> Mon, 05 Jan 2009 03:34:57 +0100
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Sorry for not replying earlier. I got sidetracked :-/ At 12:00 27/12/2008, Roger Binns <[email protected]> wrote: >You may find it convenient to use named bindings when all the values are >in local variables. locals() returns a dict of local variables, so the >above could be written as: > > cursor.execute("INSERT INTO person (name, address, tel, web, email) >VALUES (:name, :address, :tel, :web, :email)", locals()) Thanks a lot for the tip. Turns out the error was due again to the fact that data was not Unicode but I didn't check for this and didn't have a .decode() line. My code/Python/APSW wasn't telling me that this was the cause. I figured it out by INSERTing one field at a time, until it failed. Cheers, Fred.