peledc
asked on
plsql - how to by pass the need for dynamic sql
On Oracle 10.2
I am looking for a way to write a plsql procedure without the use of dynamic SQL.
Inside I need to add a where clause with a parameter that is actually a concatinated list of values:
proedure foo (p_list in varchar2) is
v_result1 number;
.
.
.
begin
select field1,field2, field3...
into v_result...
from my_table
where id in (p_list) ; -- This is the dilema!!!
end;
/
The procedure is being called like this:
foo ('3,5,5656,77');
I know how to do it with dynamic SQL, looking for a way to avoid it.
any ideas?
I am looking for a way to write a plsql procedure without the use of dynamic SQL.
Inside I need to add a where clause with a parameter that is actually a concatinated list of values:
proedure foo (p_list in varchar2) is
v_result1 number;
.
.
.
begin
select field1,field2, field3...
into v_result...
from my_table
where id in (p_list) ; -- This is the dilema!!!
end;
/
The procedure is being called like this:
foo ('3,5,5656,77');
I know how to do it with dynamic SQL, looking for a way to avoid it.
any ideas?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.