Why Doesn't This MySQL Statement Execute?

John Gordon gordon at panix.com
Tue Dec 18 22:57:41 EST 2012


In <mailman.1037.1355875874.29569.python-list at python.org> Tom Borkin <borkintom at gmail.com> writes:

> Actually, what I originally had was:
> cursor.execute("""insert into interactions values(Null, %s, "Call Back",
> %s)""", (i_id, date_plus_2))
> and that didn't work, either. I tried your variation like:
> cursor.execute("""insert into interactions values(Null, %s, "Call Back",
> %s)""" % (i_id, date_plus_2))
> and no cigar :(
> Tom

Have you tried using single-quotes around Call Back, instead of
double quotes?  I've noticed that SQL statements prefer single-quoted
strings (although that may be Oracle specific, as that's all I've really
worked with).

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list