sql statement generation problem

Hugh h.e.w.frater at cs.cf.ac.uk
Wed Apr 24 20:43:46 EDT 2002


when using the following line to create an sql statement:  query2 =    
"select * from tblitem where itemtypeid = %(itemTypeID)s and %(searchIn)s
like '%(query)s'" % sqlValues    

it works, but it need to have this  like '%%(query)s%' so that oracle will
 perform the search properly. However, the extra %'s seem to mess things  
up. Is there any way to get round this. Also, DCOracle2 is returning 1.0 
for a value of 1 in the database. This is totally messing things up, and I
need to find a way round this.

Any ideas,
Hugh




More information about the Python-list mailing list