PySQLite Problem

alc at PublicPropertySoftware.com alc at PublicPropertySoftware.com
Sat May 10 02:00:35 EDT 2003


Jeremy Fincher wrote:
> 
	# Should that be == in your code above?

IIRC, the SQLite docs say that either = or == is ok?  I assume 
that PySQLite works the same.  It seems to.  

> cursor.execute(sql, nodeSequence, newTitle, newTime, aName, aNode)
> 
> PySQLite will handle all the quoting -- you'll note that I don't have
> your single quotes in the sql string.
> 

Oh, yes.  That's wonderful.  Somehow the examples that I looked 
at used the  cursor.execute(sql % (arg1, arg2, ...)) 
style.  Anyhow, thanks for the good news.  I've got some code
to change, but it's not nearly as bad as it could be.

BTW, I'll warn anyone who might make the same error that this 
crash left my database completely mangled and unusable.  I had
a backup from only a couple hours previous, no sweat. Only it's
a test database.  Never have such good luck when it's production.

> > TIA for not laughing.
> 
> Don't worry, I did the exact same thing when I started using Python
> and SQL together :)

Glad you understand, and thanks very much.


Al




More information about the Python-list mailing list