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 ?    18 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

why do we validate the records while developing interface?

3 Answers   TCS,


in sql *loder how to skip the middle records ex:from 10th to 20th records i want to skip?

2 Answers   Oracle, Schneider,


How You Will display the key flexifields in your report

3 Answers   TCS,


Hi  Friends this is preetham, i am  searching for job on oracle apps(technical) i put 3 years fake exp, so any one  please could you help me for realtime interview  questions and 9739782164 this is my no srpsrp777@gmail.Com please guys please provide your no for contact i have a doubts i want to clarify

0 Answers   IBM,


why r u move in the cus_top only why not move another top

4 Answers  


what is the difference between oracle applications ebs 11.5.9 and 11.5.10.2 and can anyone suggest the release dates of the versions

1 Answers  


Can you have two stored functions with in the same name?

3 Answers  


In thet custom.pll what are the events we can write.

2 Answers   IBM,


we have 10 records. It's occured error in 6th record how can u find and how to rectify that?

2 Answers  


where the accounting related data is stored ?

2 Answers  


what r the objects u have to do in u experiance

1 Answers  


What is the Exception. Types of exception, Difference between those. And example

2 Answers   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 (136)
  • Oracle Install Base (62)
  • Oracle Service Contracts (101)
  • Oracle Apps AllOther (12)