Converting from local -> UTC

M.-A. Lemburg mal at egenix.com
Fri Jul 18 00:01:57 CEST 2008


On 2008-07-17 22:43, Dennis Lee Bieber wrote:
> On Thu, 17 Jul 2008 19:55:44 +0200, "M.-A. Lemburg" <mal at egenix.com>
> declaimed the following in comp.lang.python:
> 
> 
>> Use binding parameters and it should work:
>>
>> query = "INSERT INTO image VALUES(%d, %d, %s, '%s')"
> 
> 	If this is MySQLdb interface:
> 
> 		query = "INSERT INTO image VALUES(%s, %s, %s, '%s')"
> 
> ... only %s is valid; all values have been converted to escaped/quoted
> string before getting to the substitution.

Right. I forgot to replace the %d's with %s's. The line should read:

query = "INSERT INTO image VALUES(%s, %s, %s, %s)"

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 17 2008)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611



More information about the Python-list mailing list