Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Dynamic sql

PL/SQL Dynamic sql

From: Steve Rainbird <steve.rainbird_at_mssint.com>
Date: 12 Jun 2004 04:22:06 -0700
Message-ID: <bc30fc0d.0406120322.6004a339@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US