|Pathologically Eclectic Rubbish Lister|
Re: Simplifying queries in DBIby erix (Vicar)
|on Mar 16, 2014 at 16:16 UTC||Need Help??|
Keep in mind that LIKE, to act as a substring search, needs to have % around the search value; either appended, or prepended, or on both sides (three different searches!); i.e.:
job LIKE 'trans01%' -- , or:
job LIKE '%trans01' -- , or:
job LIKE '%trans01%'
And job LIKE 'trans01' means: job equals 'trans01'. It is possible but unlikely because if you wanted equality you would normally spell it job = 'trans01'
If you use place holders: column like ( '%' || ? || '%' )
BTW, it seems you'd better forget about the ESCAPE '!' as they are not used in your statement anyway.
BTW 2: LIKE '%' doesn't do anything at all it seems so better to leave them out.