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 ?    34 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 ?    17 Yes 2 No

Answer / reddy

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

Is This Answer Correct ?    3 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 thet custom.pll what are the events we can write.

2 Answers   IBM,


1—how we can create multi reports in xml publishers Ans: 2—how to print multi currency,multi language in xml 3—what are the validations in sql*loader 4—where u can get data file 5—where u r putting control file and where the bad file discard file generated 6—how to print external date in xmlp 7—in data file fields terminated by different sybals how you can write code in ctrl file 8—how to use date function in sql*loader 9—which path u have used in sql*loader 10—what are utl file triggers 11—where u can find errorbuf ret code 12 how we can know weather procedure is successfully executed from backend 13—data file contains how many levels 14—what kind of errors u got in discard file 15—how you can skip the records in thr middle of data file and end of data file 16—invoice created and send to the gl but we don’t know the invoice number how we can know 17—where u devlop interface program local syst or server system 18—how we can know how many receipts are created for a po 19—after completion of po interface into base table how we can see etair line header info in single table. 20—how to save a workflow in database in short cut? Can we delete workflow how 21—what are the common errors in workflow 22—strong cursor and weak cursor 23—what is external table where we will use 24—we have 50 record while printing in rdf report we have print 10 records per page how u can do 25—what is the difference between workflow and oracle alert 26—hot to implement muli org in interface approach 27—while loading records if the records no>=10 then all the records should be discarder,then error message populated how you can achieve 28—while picking the sales aorder qty is there in shipping there is no qty then what u will you will do 29—what is the next step after back order 30—if we do any modification in po_headers_v is it effects the base tables 31—what is tca architecture 32—where we can see the invoice payment 33—when selection existing customer in om what you will do 34—how to pass the values for the variables in api. 35—can we use look up values instead of profile options. 35—how to create ldt lct files? 36—how to tranfor on file from one instance to another instance?

1 Answers   IBM,


List some exceptions other than NO_DATA_FOUND, TOO_MANY_ROWS and WHEN OTHERS

3 Answers   Satyam,


How to find which company will be conducted Oracle appa interview? Plz help me

3 Answers  


What is the most critical part which you had faced in your project ?

1 Answers   Satyam, LG,


IN WHICH MODULE THE LEGAL ENTITY COMES?

5 Answers  


What is the autonomous transaction?give me example?

2 Answers   Cap Gemini,


Hoe to skip middle of the record by using SQL*Loader?

4 Answers  


What is invoice?

3 Answers   Murugappa Group,


How to create multi-layout reports ? If we have 5 layouts , then how to get into the 4th one ?

3 Answers   IBM,


what is latest version in reports

8 Answers  


How to print multi currency,multi language in xml?

1 Answers  




Categories
  • Oracle Apps Technical (503)
  • Oracle Apps Financial (754)
  • Oracle Apps Manufacturing (52)
  • Oracle Apps HRMS (82)
  • Oracle Apps CRM (9)
  • Oracle Apps SCM (136)
  • Oracle Install Base (62)
  • Oracle Service Contracts (101)
  • Oracle Apps AllOther (12)