Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql

oracle

plsql

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: 
;
like image 694
Bhabani Sankar Mishra Avatar asked Aug 06 '11 14:08

Bhabani Sankar Mishra


1 Answers

In a PL/SQL block select statement should have an into clause:

DECLARE
 v_department egpl_department.department_name%type;
BEGIN 
  select department_name 
  into   v_department
  from   egpl_department 
  where  department_id in (select department_id from egpl_casemgmt_activity); 

  -- Do something useful with v_department
END; 
like image 131
diederikh Avatar answered Oct 05 '22 22:10

diederikh