2016-03-26 9 views
0

パッケージと手順を確認してください。警告:コンパイルエラーでパッケージ本体が作成される

マイパッケージ:

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

これは私の体である:

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; 
/

警告は何ですか?どうして?

答えて

6

警告が表示される場合:Errors: check compiler log

を、その後show errorsコマンドを実行し、エラーログが表示されます:BEGIN ENDブロックは任意のコマンドが含まれていないため、Oracleは不平を言うあなたのパッケージ本体の場合

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 

を。
Oracleでは、BEGIN-ENDブロックに少なくとも1つのコマンドが含まれている必要があります。何も実行したくない場合(NULLコマンドの後にセミコロンを置くことを忘れないでください)、NULLにすることができます:

PROCEDURE ...... 
IS 
BEGIN 
    NULL; 
END; 
関連する問題