Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Help! Using Variable String as Argument in "where in" clause
Hmmm... You're string construction is by the book.
Silly question: In your statement "select 'x' from...", does 'x' merely represent some set of column values, or are you selecting 'INTO' a corresponding set of variables?
-Brendan
brendan_o'brien_at_wrightexpress.com
In article <3560ec86.112884517_at_news.mindspring.com>,
theslays_at_mindspring.com wrote:
>
> Please email any responses to als_at_akc.org
>
> Thank you in advance for your help
>
> I'm trying to use a variable defined as a string of values in a SQL
> select statement. So far, defining a variable as a string of values
> works when I run the SQL but doesn't select anything when I try to
> execute the same statement as part of a PL/SQL procedure's cursor.
> Any tips?
>
> Example:
> IF some_condition = 1 then
> v_string := '''A'',''B'',''C''';
> ELSIF some_condition = 2 then
> v_string := '''D'',''E'',''F''';
> ELSE v_string := '''G'',''H'',''I''';
> END IF;
>
> Select 'x'
> from my_table
> where my_field in (v_string);
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue May 19 1998 - 06:55:23 CDT