[DB-SIG] How to pass parameter with LIKE

Andy Todd andy47 at halfcooked.com
Wed Oct 25 11:44:12 CEST 2006


Janice Sterling wrote:
> I am trying to use a sql query where i'm passing a parameter
>  
> sql_str = "SELECT mrc_code FROM blocks where mrc_code LIKE '%s'" % (blkfld)
>  
> where blocks would be 31103a1, 31103e1, 31103a5, 31103e5
> 
> 
> ------------------------------------------------------------------------
> 

That should be fine as long as you use bind parameters. Which database 
and DB-API module are you using?

Regards,
Andy
-- 
--------------------------------------------------------------------------------
 From the desk of Andrew J Todd esq - http://www.halfcooked.com/


More information about the DB-SIG mailing list