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 ?    35 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 ?    19 Yes 3 No

Answer / reddy

we have to declare an attribute before using in the program
called forward declaration

Is This Answer Correct ?    4 Yes 1 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 / avinash

It is required in case of private members only not public

Is This Answer Correct ?    2 Yes 3 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

Post New Answer



More Oracle Apps Technical Interview Questions

IN WHICH MODULE THE LEGAL ENTITY COMES?

5 Answers  


what are the steps to develop a new report?

7 Answers   Satyam, Infotech,


How to print multi currency,multi language in xml?

1 Answers  


what is the error you will get if field is referenced in wrong repeating frame?

1 Answers  


how many layout sections are tehre in layout editor?

1 Answers  


What is procedure?

3 Answers  


Hi, can anybody tell me where is the requirement of Oracle Apps (functional+technical) in industry,Iwant to join there,If possible than call me---9313174232

0 Answers  


what is mean by confine mode and flexi mode?

2 Answers  


maximum how many parameters we can pass through pl/sql stored procedure to oracle apps?how many mandatory parameters we can pass through pl/sql program to oracle apps11i?

6 Answers   LG Soft,


How do u customize the Reports?

1 Answers  


in which table sub inventory related information for item is stored?

3 Answers   Scan Steel, chain sys,


What is set function in sql .E.g.What is difference between union and union all

2 Answers   TCS, IBM,




Categories
  • Oracle Apps Technical (503)
  • Oracle Apps Financial (761)
  • Oracle Apps Manufacturing (53)
  • Oracle Apps HRMS (82)
  • Oracle Apps CRM (9)
  • Oracle Apps SCM (137)
  • Oracle Install Base (62)
  • Oracle Service Contracts (101)
  • Oracle Apps AllOther (12)