On Wed, Dec 19, 2012 at 2:57 PM, John Gordon <gor...@panix.com> wrote:
> In <mailman.1037.1355875874.29569.python-l...@python.org> Tom Borkin 
> <borkin...@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).

The SQL standard specifies single quotes, but MySQL and the SQL
standard aren't always on speaking terms. It depends on the MySQL
settings as to whether "asdf" means 'asdf' or means a column named
asdf.

But if that's what the problem is, there ought to be an exception
coming back, surely? I'm not familiar with the Python MySQL bindings,
but that's what I would expect.  What, specifically, does "no cigar"
mean? It executes without errors but does nothing? It purchases a gun,
aims at your shoe, and pulls the trigger?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to