I have 2 packages A and B. Now package A references Package B
and Package B references Package A. How do you compile such
inter-dependent objects in PL/SQL
Answer Posted / anil
I assume this question as:
") I have 2 programs A and B. Now program A references Program B and Program B references Program A. How do you compile such inter-dependent objects in PL/SQL"
ANS:We can compile mutually referencing programmes using FORWARD declaration(specifying the declaration of one program in beginning of package body) inside a PACKAGE.
Example:
CREATE OR REPLACE PACKAGE test_pack
IS
gvar NUMBER:=0;
--PROCEDURE p1; --we can also achieve like this
END;
/
CREATE OR REPLACE PACKAGE BODY test_pack
IS
PROCEDURE p1; --forward declaration
PROCEDURE p2
IS
BEGIN
P1;
END;
PROCEDURE p1
IS
BEGIN
p2;
END;
END;
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is cursor explain with example?
How you improve the performance of sql*loader? : aql loader
What are two statement types in sql?
What is the use of function "module procedure" in pl/sql?
how to run 'mysql' commands from a batch file? : Sql dba
What are character functions?
What is type and rowtype in pl sql?
Why do we need pl sql?
Can we use having without group by in sql?
What is varchar used for?
What is 19 null in sql?
what's the difference between a primary key and a unique key? : Sql dba
Does truncate free space?
How do I count records in sql?
how to get a list of indexes of an existing table? : Sql dba