Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Calgary, Canada
    Posts
    3

    Unanswered: PL/SQL namespace.table.column%TYPE question

    Hello,

    I've got the following procedure declaration (for hw):

    Code:
    CREATE OR REPLACE
    PROCEDURE num_sections(cnum IN db519r.course.course_no%TYPE) IS
    cname db519r.course.description%TYPE;
    sections INTEGER;
    BEGIN
    ...
    When trying to add this procedure, I get the follwing error:
    Code:
    Errors for PROCEDURE NUM_SECTIONS:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0      PL/SQL: Compilation unit analysis terminated
    1/32     PLS-00201: identifier 'DB519R.COURSE' must be declared
    
    Warning: Procedure created with compilation errors.
    The column course_no is in a table course in a schema or namespace (I'm not sure of the terminology) called db519r, hence the three dots. I guess this may not be legal syntax? How would I go about doing this?

    Thanks,
    Mike

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: PL/SQL namespace.table.column%TYPE question

    The syntax is correct. However, to reference db519r.course in a procedure the procedure owner must have been granted access to that table directly, not via a role, i.e.:

    User db519r> grant select on course to hw;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •