Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: wild cards in Vertica

by KurtSchwind (Chaplain)
on Jul 01, 2015 at 12:03 UTC ( [id://1132792]=note: print w/replies, xml ) Need Help??


in reply to wild cards in Vertica

It looks like you have a space between $clnm and the %. In SQL "A %" will match A <space> anything. I think from you description you want "A%". Try

if ($clnm ne "") { $Where = $Where . qq(AND m.CLNAME LIKE '$clnm).qq(% +’ OR m.CLNAME IN ('$clnm') ); }.
--
“For the Present is the point at which time touches eternity.” - CS Lewis

Replies are listed 'Best First'.
Re^2: wild cards in Vertica
by pragov (Novice) on Jul 13, 2015 at 13:28 UTC
    Hi, I have this function as
    if ($clnm ne ""){ $cnt = @parts = split(/\,/, $clnm); # $clnm = "'"; $WHERE = $WHERE ." AND ("; for ($i = 0; $i < $cnt; $i++) { $WHERE = $WHERE . "m.CLNAME LIKE '$parts[$i]%' "; ($WHERE = $WHERE . " OR ") if ($i < $cnt - 1); } $WHERE = $WHERE . ")"; }
    How do I use this to get your statement if ($clnm ne "") { $Where = $Where . qq(AND m.CLNAME LIKE '$clnm).qq(% +’ OR m.CLNAME IN ('$clnm') ); }? Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1132792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-19 00:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found