How to call a PL/SQL procedure be name stored in table?
I have a table in Oracle DB which has a field where procedure names are stored. my goal is to create a menu procedure with a number parameter. So when i call it i want it to get procedure name by it's id(the number which was passed) f开发者_如何学Pythonrom this table and call the procedure. Hope i'm clear enough...
p.s I'm making a PL/SQL Server Page if it matters...
The solution is Dynamic PL/SQL:
procedure runproc (p_procname varchar2) is
begin
execute immediate 'begin ' || p_procname || '; end;';
end;
Use bind variables for the parameters. Since each procedure probably takes a different number of parameters you may need to use the DBMS_SQL package.
精彩评论