CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Wild Card params



Jun 30, 2015, 10:46 AM

Post #1 of 1 (3042 views)
Wild Card params Can't Post

Hi All,

I have a perl-Vertica question.

I need to pass a combination of a wild card and complete value of a field. It will be a combination of prefix and others.

The example is ('A','BCD-UT1','MDO-CT1').

The actual value of A is ABC-EF2.But users can just click on Prefix,A to get all values starting with A.

I tried,

if ($clnm ne ""){
$cnt = @parts = split(/\,/, $ clnm );
$clnm = "'";
for ($i = 0; $i < $cnt; $i++) {
$clnm = $clnm . $parts[$i];
($clnm = $clnm . "%','") if ($i < $cnt - 1);
$clnm = $clnm . "%'";
and then used it in

if ($clnm ne "") { $Where = $Where . "AND m.CLNAME LIKE $clnm % OR m.CLNAME IN ($clnm ) "; }.

It is not working.

The SQL either takes LIKE('A%') or IN ('ABC-EF2','BCD-UT1','MDO-CT1'), but not the combination.

How to retrieve the value,('A','BCD-UT1','MDO-CT1')?




Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives