Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Dynamic sql
Is it possible to generate what I would call Dynamic PL/SQL?
What I am trying to do is the following.
I want to assign a value to a variable in PL/SQL but I don't know the name of the variable until run time.
I have tried the following (and many other variations) without success.
declare
exstring varchar2(500);
varname varchar2(20);
var number;
begin
var:=1;
varname:='var';
exstring:='begin :1 := 5; end;';
execute immediate exstring using in out varname;
dreamer.dream ('var=' || var);
end;
/
Any help appreciated.
Steve Received on Sat Jun 12 2004 - 06:22:06 CDT