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 -> Dynamically execute PL/SQL statement

Dynamically execute PL/SQL statement

From: Agoston Bejo <gusz1_at_freemail.hu>
Date: Fri, 29 Oct 2004 12:46:24 +0200
Message-ID: <clt7a9$ruj$1@news.caesar.elte.hu>


I am looking for the PL/SQL equivalent of the VBScript Exec and/or Eval functions, i.e. I want to be able to dynamically create a statement, then execute it in the current PL/SQL context, e.g.

declare
 x integer := 5;
begin

    ExecuteStatement('x := 10');
    dbms_output.put_line(x); -- should put "10"     if EvaluateExpression('x*2 = 20') then

        dbms_output.put_line('Yes');
    else

        dbms_output.put_line('No');
    end if; -- should put 'Yes'
end;

EXECUTE IMMEDIATE doesn't seem to work, because it runs the statement in the global context, not inside the context of the current function. Received on Fri Oct 29 2004 - 05:46:24 CDT

Original text of this message

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