pragov has asked for the wisdom of the Perl Monks concerning the following question:
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, pragov
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: wild cards in Vertica
by KurtSchwind (Chaplain) on Jul 01, 2015 at 12:03 UTC | |
by pragov (Novice) on Jul 13, 2015 at 13:28 UTC | |
|
Re: wild cards in Vertica
by GotToBTru (Prior) on Jun 30, 2015 at 18:16 UTC | |
by pragov (Novice) on Jun 30, 2015 at 18:26 UTC | |
by GotToBTru (Prior) on Jun 30, 2015 at 18:32 UTC | |
by pragov (Novice) on Jun 30, 2015 at 19:20 UTC | |
by GotToBTru (Prior) on Jun 30, 2015 at 19:25 UTC | |
| |
|
Re: wild cards in Vertica
by chacham (Prior) on Jul 01, 2015 at 12:12 UTC |