In the Event that you have more than one local declared procedure or
Function within a block of Pl sql and the procedure must reference each
Other, you won't be able to compile your code without getting an error.
Each local procedure must be declared before the other.
To get around this problem, you can use a forward declaration to specify
the interface for the procedures. This will allow your Plsql block to
compile without errors.
DECLARE
PROCEDURE P2; -- forward declaration
PROCEDURE P3;
PROCEDURE P1 IS
BEGIN
dbms_output.put_line('From procedure p1');
p2;
END P1;
PROCEDURE P2 IS
BEGIN
dbms_output.put_line('From procedure p2');
p3;
END P2;
PROCEDURE P3 IS
BEGIN
dbms_output.put_line('From procedure p3');
END P3;
BEGIN
p1;
END;
0 comments:
Post a Comment