Re: help with mysql cursor.execute()

2005-08-16 Thread William Gill
Dennis Lee Bieber wrote: > On Sun, 14 Aug 2005 19:28:04 GMT, William Gill <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>I have been trying to pass parameters as indicated in the api. >>when I use: >> >> sql= 'select * from %s where cusid = %s ' % name,recID) >> Cur

Re: help with mysql cursor.execute()

2005-08-15 Thread William Gill
Steve Holden wrote: > William Gill wrote: > >> I have been testing and it seems that: >> >> 1- Cursor.execute does not like '?' as a placeholder in sql >> > The particular format required by each DBI-compatible module should be > available as the module's "paramstyle" variable. mxODBC, for exam

Re: help with mysql cursor.execute()

2005-08-15 Thread Steve Holden
William Gill wrote: > I have been testing and it seems that: > > 1- Cursor.execute does not like '?' as a placeholder in sql > The particular format required by each DBI-compatible module should be available as the module's "paramstyle" variable. mxODBC, for example, uses the "qmark" style, but

Re: help with mysql cursor.execute()

2005-08-14 Thread William Gill
I have been testing and it seems that: 1- Cursor.execute does not like '?' as a placeholder in sql 2- Cursor.execute accepts '%s' but puts the quotation mark around the substitution. sql = 'select * from %s where cusid = ? ' % name Cursor.execute(sql, (recID,)) still fails, but: sql

Re: help with mysql cursor.execute()

2005-08-14 Thread Scott David Daniels
William Gill wrote: > I have been trying to pass parameters as indicated in the api. > when I use: > sql= 'select * from %s where cusid = %s ' % name,recID) > Cursor.execute(sql) > it works fine, but when I try : > sql= 'select * from %s where cusid like %s ' > Cursor.execute(sql,(name,recI

help with mysql cursor.execute()

2005-08-14 Thread William Gill
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql= 'select * from %s where cusid like %s ' Cursor.execute(sql,(name,recID)) or sql= 'select *