thealchemist
thealchemist

Reputation: 407

Strange PL/SQL error - PLS-00103

I have been getting a rather strange error for a long time in SQL developer.. I have stripped my package to the most basic and ran a variable declaration.. and even that is throwing an error.. this is what I am executing:

create or replace package body cdbmeta.pkg_metadata_check 
is
 procedure p_metadata_check(unit_id_start in number, unit_id_end in number)
   is
    begin      
     start_date NUMBER(10);
     dbms_output.put_line('..');     
    end;
end;

and my error message states:

PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "NUMBER" to continue.

Totally clueless.. anyone had this before?

Upvotes: 2

Views: 585

Answers (1)

pmi
pmi

Reputation: 351

You have to put definition of variables after the "is" and before "begin" as follows:

create or replace package body cdbmeta.pkg_metadata_check 
is
 procedure p_metadata_check(unit_id_start in number, unit_id_end in number)
   is
     start_date NUMBER(10);
    begin      
     dbms_output.put_line('..');     
    end;
end;
/

The block in procedure definition after is and before begin is the same as You would use with anonymous block like this:

 declare
   start_date NUMBER(10);
 begin      
   dbms_output.put_line('..');     
 end;
 /

Upvotes: 4

Related Questions