Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: September 29, 2016 - 6:32 am UTC

Last updated: September 29, 2016 - 12:47 pm UTC

Version: 11g

Viewed 1000+ times

You Asked

my question is...if name of procedure along with procedure name and parameters are given in package specification but body of "procedure" is not given in package body will the procedure is going to work ..? if not ...why..? if yes then how..?

and Connor said...

Nope

SQL> create or replace
  2  package pkg is
  3    procedure P1;
  4    procedure P2;
  5  end;
  6  /

Package created.

SQL>
SQL>
SQL> create or replace
  2  package body pkg is
  3    procedure P2 is begin null; end;
  4  end;
  5  /

Warning: Package Body created with compilation errors.

SQL>
SQL> sho err
Errors for PACKAGE BODY PKG:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/13     PLS-00323: subprogram or cursor 'P1' is declared in a package
         specification and must be defined in the package body




Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library