PLSQL & dyn generating sql (& oracle forms)

From: sven <sbraem_at_levi.com>
Date: 11 Dec 2002 07:14:44 -0800
Message-ID: <48ca1f99.0212110714.53b5428f_at_posting.google.com>


Hi,

I have a cursor with a where clause that should be somewhat dynamically.

cursor c1 is
select *
from table
where field in (v_variable)

the variable will be filled up before the cursor is opened. But the way the variable needs to be filled gives me a problem.

if I do
v_variable := 'test'
then it is ok and it returns rows.

if I do
v_variable := 'test, test2'
then it doesn't (while both values are valid)

What I was thinking.. in the select the v_variable will be replaced by 'contentofthevariable'. With the quotes, otherwise it's an unknown field.

So if I want to work with multiple values, does it mean i have to make something like this?
v_variable := 'test'',''test2'

Because it ain't working either. And neither does v_variable := '''test'',''test2'''

Any idea's on this? Received on Wed Dec 11 2002 - 16:14:44 CET

Original text of this message