Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'warnings': 0.03; 'tom': 0.07; 'subject:Why': 0.09; 'tia,': 0.09; '%s,': 0.16; 'hi;': 0.16; 'command': 0.24; 'errors.': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'interactions': 0.29; 'prints': 0.29; 'skip:& 10': 0.29; 'print': 0.32; 'to:addr:python-list': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'test': 0.36; 'execute': 0.37; 'does': 0.37; 'received:209': 0.37; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'subject:This': 0.78; '\xa0\xa0\xa0\xa0\xa0': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tQdCLn+WyzwACEXwl5gX6+UfTKOuDtri4qHTxmuXbew=; b=K9k4tgZ8OICviBDxh/PfjLrPUxS7T/iSWOTcQ8o1ErkR/zyBeJH6rO5qjaDgin/ke1 wAGLtJ3iM4OK4ooLeQT/qlLh7+8XwsSonCE+onUMGzjaAKQbnQ5j9MjeCdHqI1oYHint F/INWl0aMcrAXlDaOylgFMuFnZFZfNW5H3UXT+5Qu1WnauLzaOtko7ZzHxFN79zVFmAs BVsPSoGz7pz3fzC+BKGj6gPpvOb6YQDvbtTiyYF8/ye2PL5pi6IdTGVOY20G0siBQwGq JDDjykC4FwCEj1Q4J+Di748jkbEeKShgxExe0fV9ybf5YWLGaIB+NkHCacc+eyDUuz4f BsIQ== MIME-Version: 1.0 Date: Tue, 18 Dec 2012 17:34:08 -0400 Subject: Why Doesn't This MySQL Statement Execute? From: Tom Borkin To: python-list@python.org Content-Type: multipart/alternative; boundary=bcaec517a5720803d204d12742d3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355866451 news.xs4all.nl 6983 [2001:888:2000:d::a6]:53552 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35073 --bcaec517a5720803d204d12742d3 Content-Type: text/plain; charset=ISO-8859-1 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 --bcaec517a5720803d204d12742d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi;
I have this test code:
=A0
=A0=A0=A0 if i_id =3D=3D "1186":
=A0=A0=A0=A0=A0 sql = =3D 'insert into interactions values(Null, %s, "Call Back", &= quot;%s")' % (i_id, date_plus_2)
=A0=A0=A0=A0=A0 cursor.execute(sql)
=A0=A0=A0=A0=A0 db.commit()
=A0= =A0=A0=A0=A0 print sql
It prints the sql statement, but it do= esn'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
--bcaec517a5720803d204d12742d3--