Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103: Encountered the symbol "CREATE"
PLS-00103: Encountered the symbol "CREATE" [message #236753] Thu, 10 May 2007 20:22 Go to next message
lnreddy
Messages: 6
Registered: October 2005
Location: Pune, India
Junior Member
Hi All,

I got the above mentioned compilation error while creating a package, can anybody help me out pls:
My code is as follows:
SQL> CREATE OR REPLACE PACKAGE course_pkg AS
  2    TYPE course_rec_typ IS RECORD
  3      (first_name    student.first_name%TYPE,
  4       last_name     student.last_name%TYPE,
  5       course_no     course.course_no%TYPE,
  6       description   course.description%TYPE,
  7       section_no    section.section_no%TYPE
  8       );
  9    TYPE course_cur IS REF CURSOR RETURN course_rec_typ;
 10    PROCEDURE get_course_list
 11      (p_student_id    NUMBER ,
 12       p_instructor_id NUMBER ,
 13       course_list_cv IN OUT course_cur);
 14  END course_pkg;
 15  
 16  CREATE OR REPLACE PACKAGE BODY course_pkg AS
 17    PROCEDURE get_course_list
 18      (p_student_id    NUMBER ,
 19       p_instructor_id NUMBER ,
 20       course_list_cv IN OUT course_cur)
 21    IS
 22    BEGIN
 23      IF p_student_id IS NULL AND p_instructor_id
 24        IS NULL THEN
 25        OPEN course_list_cv FOR
 26          SELECT 'Please choose a student-' First_name,
 27                 'instructor combination'   Last_name,
 28            NULL     course_no,
 29            NULL     description,
 30            NULL     section_no
 31            FROM dual;
 32      ELSIF p_student_id IS NULL  THEN
 33        OPEN course_list_cv FOR
 34          SELECT s.first_name    first_name,
 35            s.last_name     last_name,
 36            c.course_no     course_no,
 37            c.description   description,
 38            se.section_no   section_no
 39     FROM   instructor i, student s,
 40            section se, course c, enrollment e
 41     WHERE  i.instructor_id = p_instructor_id
 42       AND  i.instructor_id = se.instructor_id
 43       AND  se.course_no    = c.course_no
 44       AND  e.student_id    = s.student_id
 45       AND  e.section_id    = se.section_id
 46       ORDER BY  c.course_no, se.section_no;
 47      ELSIF p_instructor_id IS NULL  THEN
 48        OPEN course_list_cv FOR
 49             SELECT i.first_name    first_name,
 50            i.last_name     last_name,
 51            c.course_no     course_no,
 52            c.description   description,
 53            se.section_no   section_no
 54     FROM   instructor i, student s,
 55            section se, course c, enrollment e
 56     WHERE  s.student_id = p_student_id
 57       AND  i.instructor_id = se.instructor_id
 58       AND  se.course_no    = c.course_no
 59       AND  e.student_id    = s.student_id
 60       AND  e.section_id    = se.section_id
 61          ORDER BY  c.course_no, se.section_no;
 62          END IF;
 63       END get_course_list;
 64  
 65  END course_pkg;
 66  
 67  /

Warning: Package created with compilation errors.

SQL> sho err
Errors for PACKAGE COURSE_PKG:

LINE/COL ERROR
-------- --------------------------------------------
16/1     PLS-00103: Encountered the symbol "CREATE"


Re: PLS-00103: Encountered the symbol "CREATE" [message #236755 is a reply to message #236753] Thu, 10 May 2007 20:45 Go to previous message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
You are missing a slash between your package specification and package body.

14 END course_pkg;
15 /
16 CREATE OR REPLACE PACKAGE BODY course_pkg AS
Previous Topic: tkprof
Next Topic: Problems creating an object VIEW that returns multiple rows from a BLOB datatype
Goto Forum:
  


Current Time: Sat Dec 10 08:42:52 CST 2016

Total time taken to generate the page: 0.07430 seconds