Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to pass procedures as parameters?
earthlink wrote:
>
> can any one tell me how to pass a procedure as a parameter,
> and execute it in the called program.
>
> TIA
>
> Phil
Sorry - let me try again now that I have read your post properly...
Use DBMS_SQL to run dynamic sql...
Example:
create procedure run_any_proc(v_proc_name varchar2) is
t integer;
d integer;
begin
t := dbms_sql.open_cursor;
dbms_sql.parse(t,'begin '||v_proc_name||'; end;',dbms_sql.native);
d := dbms_sql.execute(t);
dbms_sql.close(t);
exception when others then
dbms_sql.close(t);
raise;
end;
In 8i, just use "execute_immediate"
--
![]() |
![]() |