Re: value expansion using binding variables?

From: Mark D Powell <Mark.Powell2_at_hp.com>
Date: Wed, 24 Aug 2011 07:04:33 -0700 (PDT)
Message-ID: <77d8b5e8-7caa-48e0-9dc0-7fa7693a6156_at_gz5g2000vbb.googlegroups.com>



On Aug 22, 5:12 pm, geos <g..._at_nowhere.invalid> wrote:
> hello, in pl/sql code I have defined a variable:
>
> x varchar2(100) := 'do not :1';
>
> is it possible to change the value of x to 'do not eat' with execute
> immediate and using 'eat' clauses? if so, how can it be done? if not,
> why not and what are the alternatives to accomplish this?
>
> thank you,
> geos
>
> ps. Follow-up to comp.databases.oracle.misc

To change a pl/sql variable value you just assign it a new value in an assignment statement:

begin
... other code
x := 'do not eat';
... more code
end;

You use execute immediate to perform dynamic SQL, not to execute pl/ sql statements.

HTH -- Mark D Powell -- Received on Wed Aug 24 2011 - 09:04:33 CDT

Original text of this message