[DB-SIG] How to pass parameter with LIKE
William Dode
wilk-ml at flibuste.net
Wed Oct 25 12:01:02 CEST 2006
On 25-10-2006, Janice Sterling wrote:
> --===============0689749057==
> Content-Type: multipart/alternative;
> boundary="----=_Part_18939_12219789.1161749671700"
>
> ------=_Part_18939_12219789.1161749671700
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> 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
you want to do
select mrc_code from blocks where mrc_code in ('31103a1', '31103e1',
'31103a5', '31103e5')
isnt'it ?
--
William Dodé - http://flibuste.net
More information about the DB-SIG
mailing list