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_at_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.
end;
Date: Fri, 29 Oct 2004 12:46:24 +0200
Message-ID: <clt7a9$ruj$1_at_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 - 12:46:24 CEST