Lay Leangsros
Lay Leangsros

Reputation: 9296

Warning: Package Body created with compilation errors

Please check my package and procedures.

My package:

create or replace package transaction1 as
    procedure enter_transaction(acc number, kind varchar2, amount number);
    procedure apply_transaction;
end;
/

This is my body:

create or replace package body transaction1 as
    procedure enter_transaction(acc in number, kind in varchar2, amount in number) 
    is

    begin

    end;

    procedure apply_transaction
    is

    begin

    end;    
end;
/

What is the warning? Why?

Upvotes: 3

Views: 16967

Answers (1)

krokodilko
krokodilko

Reputation: 36107

If you see a warning: Errors: check compiler log

then run show errors command and you will see the error log :

7/5            PLS-00103: Encountered the symbol "END" when expecting one of the following:

   ( begin case declare exit for goto if loop mod null pragma
   raise return select update while with <an identifier>
   <a double-quoted delimited-identifier> <a bind variable> <<
   continue close current delete fetch lock insert open rollback
   savepoint set sql execute commit forall merge pipe purge

14/5           PLS-00103: Encountered the symbol "END" when expecting one of the following:

   ( begin case declare exit for goto if loop mod null pragma
   raise return select update while with <an identifier>
   <a double-quoted delimited-identifier> <a bind variable> <<
   continue close current delete fetch lock insert open rollback
   savepoint set sql execute commit forall merge pipe purge

In case of your package body Oracle complains because BEGIN END blocks don't contain any commands.
In Oracle the BEGIN-END block must contain at least one command. Could be NULL, if you don't want to run anything (and don't forget to place a semicolon after NULL command):

PROCEDURE ......
IS
BEGIN
  NULL;
END;

Upvotes: 10

Related Questions