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 can sql server reporting services do?
What is the difference between instead of trigger and after trigger?
difference between anonymous blocks and sub-programs.
How to place comments in pl/sql?
How do I view a procedure in sql?
Explain about various levels of constraint.
What is before and after trigger?
Can you join a table to itself?
Is left join inner or outer?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
How do I run a program in pl sql?
what is rollback? : Sql dba
How does a trigger work?
how to return query output in html format? : Sql dba
How do you use a while loop in pl sql?