Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: cursor parameter and SQL WHERE clause
... and if p_in is not a PL/SQL variable, the other issue is that '_'
- underscore - embedded in a string means 'single wildcard', as '%' -
percent - means 'any number of wildcards'.
Mark
On Sat, 19 Jun 1999 09:27:11 -0400, Kenneth C Stahl <kcstahl_at_ix.netcom.com> wrote:
>Why are you putting p_in in quotes. It is a pl/sql variable. Just use it
>without quotes.
>
>Ken
>
>Hans Xie wrote:
>>
>> Hi all,
>>
>> I need to use a cursor paramter in SQL WHERE clause for a LIKE condition.
>> There must be a way to do it, but I just can not fig out the syntax.
>>
>> Example code:
>>
>> CURSOR c1(p_in) IS
>> SELECT *
>> FROM tab1
>> WHERE col1 LIKE 'p_in%';
>>
>> The problem is at the last line, 'p_in%'. But it doesn't work. What is the
>> right syntax to implement this? Or is it impossible to do it?
>>
>> Thanks in advance.
>> Hans Xie
Received on Thu Jun 24 1999 - 11:04:17 CDT