935
935

Reputation: 59

PLSQL Nonsense (?) Error PLS-00103 in Package and Package Body

I'm getting what I believe to be a nonsensical error for a procedure.

CREATE OR REPLACE PACKAGE reg AS
    TYPE ref_cursor IS ref cursor;
    ...
    FUNCTION show_enrollments RETURN ref_cursor;
    PROCEDURE return_prereqs
        (param_dept_code IN prerequisites.dept_code%type,
        param_course_no IN prerequisites.course_no%type);
>   PROCEDURE enroll
>       (param_sid IN enrollments.sid%type,
>       param_classid IN enrollments.classid%type,
>       err_msg OUT varchar(76));
    PROCEDURE delete_student
        (param_sid IN enrollments.sid%type);
    ...
END;
/
show errors

The error I get for the package

 LINE/COL ERROR
 -------- -------
 31/23    PLS-00103: Encountered the symbol "(" when expecting one of the
          following:
          := . ) , @ % default character
          The symbol ":=" was substituted for "(" to continue.

And the error I get for the package body

 LINE/COL ERROR
 -------- -------
 328/23   PLS-00103: Encountered the symbol "(" when expecting one of the
          following:
          := . ) , @ % default character
          The symbol ":=" was substituted for "(" to continue.

This is the procedure in the package body

PROCEDURE enroll
    (param_sid IN enrollments.sid%type,
    param_classid IN enrollments.classid%type,
    err_msg OUT varchar(76)) 
IS...

Am I doing something stupid here? I can't see what's wrong and it's pretty frustrating.

Upvotes: 0

Views: 170

Answers (2)

Paras
Paras

Reputation: 338

Hello there Please remove the size from the procedure as following:

  PROCEDURE enroll
       (param_sid IN enrollments.sid%type,
       param_classid IN enrollments.classid%type,
       err_msg OUT varchar2);

here i have change name also but you can keep yours

With size:

enter image description here

After removing size:

enter image description here

Upvotes: 1

gvenzl
gvenzl

Reputation: 1891

I'm pretty sure it's err_msg OUT varchar(76) as there is no VARCHAR data type in Oracle but only a VARCHAR2.

Try:

PROCEDURE enroll
    (param_sid IN enrollments.sid%type,
    param_classid IN enrollments.classid%type,
    err_msg OUT varchar2(76)) 
IS...

See SQL Data Types in the PL/SQL Language Reference for further information.

Upvotes: 2

Related Questions