Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.oracle    |    Overblown overpriced overengineered SHIT    |    2,288 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,905 of 2,288    |
|    Agoston Bejo to All    |
|    Dynamically execute PL/SQL statement    |
|    29 Oct 04 12:46:24    |
   
   XPost: comp.databases.oracle.server   
   From: gusz1@freemail.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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca