PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ;

Viewed 119071

I am running the following script -

BEGIN
    select department_name 
    from egpl_department 
    where department_id in (select department_id 
                            from egpl_casemgmt_activity);
END ;

And got the Error -

PLS-00103: Encountered the symbol "end-of-file" when 
expecting one of the following: 
;
6 Answers

Most people would not consider the call to be the issue,

but here's an amusing bug in Oracle Sql Developer that may emulate the issue..

exec dbowner.sp1 ( p1, p2, p3); -- notes about the fields

Error report - ORA-06550: line 1, column 362: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:

exec dbowner.sp1 ( p1, p2, p3); 
-- notes about the fields

PL/SQL procedure successfully completed.

DECLARE is only used in anonymous PL/SQL blocks and nested PL/SQL blocks.

You do not need to use the DECLARE key word before you 'introduce' a new variable in a Procedure block, unless .... the procedure is a nested PL/SQL block.

This is an example of how you would declare a variable without the 'DECLARE' Key word below.

eg.;

CREATE OR REPLACE PROCEDURE EXAMPLE( A IN NUMBER, B OUT VARCHAR2 )
IS  
  num1 number;
BEGIN  
  num1:=1;
  insert into a (year) values(7);    
END; 

This question/answer explains it better

create procedure in oracle

Related