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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Wild Card params

 



pra_perl
Novice

Jun 30, 2015, 10:46 AM

Post #1 of 1 (2536 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')?

Thanks,

pra_perl

 
 


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

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