Question : Oracle packages

I have three procedures and a function in a package. Is it possible to execute the whole package instead of executing package.procedure_name. Can you provide me the syntax?

Thanks

Answer : Oracle packages

No you can only execute single procedures and packages.
Ofcourse you can add another procedure or function that executes all

create or replace package example
is

procedure p1;
procedure p2;
procedure p3;
function f1 return varchar2;

function exec_all return varchar2;
end;
/

create or replace package body example
is

procedure p1
is
begin
 dbms_output.put_line('executing p1');
end;
procedure p2
is
begin
 dbms_output.put_line('executing p2');
end;
procedure p3
is
begin
 dbms_output.put_line('executing p3');
end;
function f1 return varchar2
is
begin
   return 'f1 executed';
end;

function exec_all return varchar2
is
begin
   p2;
   p3;
   p1;
   return f1;
end;

end;
/

executing in sqlplus

set serveroutput on

  1  begin
  2    dbms_output.put_line(example.exec_all);
  3* end;
SQL> /
executing p2
executing p3
executing p1
f1 executed

PL/SQL-procedure is geslaagd.

SQL> select example.exec_all from dual;

EXEC_ALL
--------------------------------------------------------------
f1 executed

executing p2
executing p3
executing p1

Random Solutions  
 
programming4us programming4us