Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35073

Why Doesn't This MySQL Statement Execute?

Date 2012-12-18 17:34 -0400
Subject Why Doesn't This MySQL Statement Execute?
From Tom Borkin <borkintom@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1029.1355866451.29569.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi;
I have this test code:

    if i_id == "1186":
      sql = 'insert into interactions values(Null, %s, "Call Back", "%s")'
% (i_id, date_plus_2)
      cursor.execute(sql)
      db.commit()
      print sql
It prints the sql statement, but it doesn't execute. If I copy and paste
the sql into the mysql command line it does execute without warnings or
errors. What gives?
TIA,
Tom

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Why Doesn't This MySQL Statement Execute? Tom Borkin <borkintom@gmail.com> - 2012-12-18 17:34 -0400
  Re: Why Doesn't This MySQL Statement Execute? Hans Mulder <hansmu@xs4all.nl> - 2012-12-18 23:57 +0100
    Re: Why Doesn't This MySQL Statement Execute? Tom Borkin <borkintom@gmail.com> - 2012-12-18 20:11 -0400
      Re: Why Doesn't This MySQL Statement Execute? John Gordon <gordon@panix.com> - 2012-12-19 03:57 +0000
        Re: Why Doesn't This MySQL Statement Execute? Chris Angelico <rosuav@gmail.com> - 2012-12-19 15:49 +1100
        Re: Why Doesn't This MySQL Statement Execute? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-19 00:40 -0500
  Re: Why Doesn't This MySQL Statement Execute? Alister <alister.ware@ntlworld.com> - 2012-12-19 13:28 +0000

csiph-web