1)what is the starting "oracle error number"?2)what is meant by forward declaration in functions?

Showing Answers 1 - 4 of 4 Answers

Rama Krishna,Yerra

  • Aug 2nd, 2006
 

Hi Suri !!

             Forward Declaration means.. If you are defining a package body having two procedures , If u want to use second procedure in the defination of first procedure.. You have to declare the second package with its arguments(if have)  before using in the defination of first procedure.. its labled as forward declaration..

Thanks&Regds

Ramki,Tata Cosnultacny Services,

Deccan Park,HYD,India

gouthami kodangal

  • Aug 15th, 2006
 

STARTING ORACLE ERROR NO IS ORA 00001

gouthami kodangal

  • Aug 15th, 2006
 

One must declare an identifier before referencing it. Once it is declared it can be referred even before defining it in the PL/SQL. This rule applies to function and procedures also

  Was this answer useful?  Yes

Surya Peri

  • Feb 17th, 2007
 

The starting is ORA0000 which means "Successful Completion".

  Was this answer useful?  Yes

g_sidhu

  • Feb 4th, 2008
 

ORA-00000:

normal, successful completion

Cause:

Normal exit.

 

PL/SQL does not allow forward references. You must declare an identifier before using it. Therefore, a subprogram must be declared before calling it. You can use forward declarations to do the following:

• Define subprograms in logical or alphabetical order

• Define mutually recursive subprograms

• Group subprograms in a package

Mutually recursive programs are programs that call each other directly or indirectly.

  Was this answer useful?  Yes

Hi,
Oracle Error message starting from ORA-00000


ORA-00000 normal, successful completion

Cause: An operation has completed normally, having met no exceptions.

Action: No action required.


Regards,
Siva.P
Birlasoft
Bangalore

  Was this answer useful?  Yes

Example of forward declaration in package :

CREATE OR REPLACE PACKAGE pkg_CBRef_Seq
AS
PROCEDURE sp_CBRCreateDropSeq_scd
( p_cod_CountryCode IN country.country_code%TYPE,
p_cod_LegVeh IN leg_veh.leg_veh%TYPE);

END pkg_CBRef_Seq;
/

CREATE OR REPLACE PACKAGE BODY pkg_CBRef_Seq
AS
/*Forward declaration for procedure as this is private to package and defined later*/
PROCEDURE sp_CBRCreateDropSeq_cd
( p_cod_CountryCode IN country.country_code%TYPE,
p_cod_LegVeh IN leg_veh.leg_veh%TYPE
);

PROCEDURE sp_CBRCreateDropSeq_scd
( p_cod_CountryCode IN country.country_code%TYPE,
p_cod_LegVeh IN leg_veh.leg_veh%TYPE)
AS
BEGIN
sp_CBRCreateDropSeq_cd(p_cod_CountryCode,cur_LegVeh);
/*procedure is called here only because it is forward declared (not defined till now)*/
END sp_CBRCreateDropSeq_scd;

PROCEDURE sp_CBRCreateDropSeq_cd ( p_cod_CountryCode IN
country.country_code%TYPE,
p_cod_LegVeh IN leg_veh.leg_veh%TYPE)
AS
BEGIN
............................/*Procedure defined here onwards....*/
END sp_CBRCreateDropSeq_cd;

A forward declaration means that modules (procedures and functions) are declared in advance of their actual body definition.

For example, if program A calls program B and program B calls program A,  PL/SQL supports mutual recursion, where two or more programs directly or indirectly call each other.

See the below example you can understand.

CREATE OR REPLACE PACKAGE my_pkg
  IS
       FUNCTION my_func
       RETURN NUMBER;
END my_pkg;
/

Package created.

CREATE OR REPLACE PACKAGE BODY my_pkg
    AS
       FUNCTION my_func2  
          RETURN NUMBER;  -- forward declaration
  
       FUNCTION my_func
          RETURN NUMBER
       IS
       BEGIN
         RETURN my_func2; -- Legal call
      END my_func;

     FUNCTION my_func2
        RETURN NUMBER
     IS
    BEGIN
        RETURN 0;
    END my_func2;
  END my_pkg;
/
Package body created.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions