Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Simplifying queries in DBI

by erix (Vicar)
on Mar 16, 2014 at 16:16 UTC ( #1078525=note: print w/replies, xml ) Need Help??

in reply to Simplifying queries in DBI

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078525]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-03-27 21:05 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (324 votes). Check out past polls.