Dynamic execution of private procedure inside the package
PatzaFeb 16 2010 — edited Feb 16 2010Hi,
I'm trying to execute the private procedure within the package dynamically (on Oracle 10g). The below is an example of my test.
create or replace package test_patza as
procedure proc_main;
end;
/
create or replace package body test_patza
as
procedure proc_output
as
begin
dbms_output.put_line('Hallo');
end;
procedure proc_main
as
begin
execute immediate 'begin proc_main(); end;';
end;
end;
/
SQL> set serverout on
SQL> exec test_patza.proc_main();
BEGIN test_patza.proc_main(); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'PROC_MAIN' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
ORA-06512: at "SCOTT.test_patza", line 11
ORA-06512: at line 1
I get the above error. Any idea how to achieve this as I need to execute some private procedures based on some conditions.
Appreciate your help.
Thanks in advance.
Regards
Pat