What is FORWARD DECLARATION in Packages?
Answers were Sorted based on User's Feedback
Answer / kiran kumar
PL/SQL allows for a special subprogram declaration called a
forward declaration. It consists of the subprogram
specification in the package body terminated by a semicolon.
You can use forward declarations to do the following:
? Define subprograms in logical or alphabetical order.
? Define mutually recursive subprograms.(both calling each
other).
? Group subprograms in a package
Example of forward Declaration:
CREATE OR REPLACE PACKAGE BODY forward_pack
IS
PROCEDURE calc_rating(. . .); -- forward declaration
PROCEDURE award_bonus(. . .)
IS -- subprograms defined
BEGIN -- in alphabetical order
calc_rating(. . .);
. . .
END;
PROCEDURE calc_rating(. . .)
IS
BEGIN
. . .
END;
END forward_pack;
Is This Answer Correct ? | 41 Yes | 3 No |
Answer / palaniraman balasubramanian
Special sub program unit declaration called forward
declaration, Consider below the example
In this pacakage, the first program unit is calling the
calc_rating but calc_rating is defined last in the package;
if we are not declared the fwd declaration then it will
raise the error While compiling this package. Package
compilation always happens top to bottom. For resolving
this compilation issue, you should declare the fwd
declaration.
CREATE OR REPLACE PACKAGE BODY forward_pack
IS
PROCEDURE calc_rating(. . .); -- forward
declaration
PROCEDURE award_bonus(. . .)
IS -- subprograms
defined
BEGIN -- in alphabetical
order
calc_rating(. . .);
. . .
END;
PROCEDURE calc_rating(. . .)
IS
BEGIN
. . .
END;
END forward_pack;
Is This Answer Correct ? | 21 Yes | 4 No |
Answer / reddy
we have to declare an attribute before using in the program
called forward declaration
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / avinash
It is required in case of private members only not public
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / pradhyumn sharma
Forward Declaration is that we must declare the procedures
or functions before using them. If we dont declare then ti
raise error.
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / ranga
if you want define the procedure in existing local procedure
on that time you will define the procedures,along with the
parameters is called forward declaration.
Is This Answer Correct ? | 6 Yes | 15 No |
hi gurus my name is ramesh i was completed orcale apps technical trainning i wnt to put 3+yrs experience is it correct r not ,if any freshers jobs are available in market pls suggest me. my mail id rameshmcaou@gmail.com and contact no is 9000342411
What do you understand by soa and what are the benefits of using this architecture?
tell me the scenarios of the independent in reports
What r the validation done in ap inbound ?
What are Mandatory triggers to write in the block, which is created on view?
Difference between set of books id and ledger id in r12 ?
which parameters passed in report in oracle developer how to pass
Is that Possible To create package Overloading , If Yes Give any Examples
Can you have two stored functions with in the same name?
what is user exit and wat program do we write in user exit?
How many standard interface programs in oracle purchasing module and oracle inventory? What are they?
What is the maximum number of statements that can be specified in a trigger statement?