Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 258
Lay Leangsros Avatar asked Oct 18 '25 19:10

Lay Leangsros


1 Answers

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;
like image 69
krokodilko Avatar answered Oct 21 '25 10:10

krokodilko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!