Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Simplifying queries in DBI

by erix (Parson)
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]
[karlgoethebier]: holli: Red Coke? It's called "Korea" - cheap red wine wine coke :-(
[choroba]: we call it "mushroom" here

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-09-25 13:37 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (280 votes). Check out past polls.