Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    58

    Lightbulb Unanswered: SQL0204N " " is an undefined name

    User was getting SQL0551N "JenB" does not have the privilege to perform operation "EXECUTE" on object "EMPLOY.P10020". SQLSTATE=42501

    I tried the following:
    Grant execute on package EMPLOY.P10020 to user JenB;

    But got this:
    SQL0204N "EMPLOY.P10020" is an undefined name.

    I saw the exact package (P10020) with the right schema (EMPLOY) under syscat.packages in the database using

    "select pkgschema, pkgname from syscat.packages where pkgname = 'P10020' "

    Why am I still getting SQL0204N "EMPLOY.P10020" is an undefined name ?

    Please advise. Thanks in advance!

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Is EMPLOY.P10020 a procedure? If so you must grant execute on the procedure, not on the package (although in version 7 you would have granted execute on the package). Check out the GRANT statement in the SQL Reference Vol 2 for more info.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Apr 2004
    Posts
    58
    Object is listed under syscat.packages so it should be a package, right?
    The same name cannot be found under syscat.procedure.

    Any other suggestions?

    Thanks.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Procedures also have packages, but you must grant execute to the procedure. Is this a program with embedded SQL (C++, etc), a function, procedure, etc? Need more info about what EMPLOY.P10020 is. Also include full info about OS, DB2 version, etc.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Apr 2004
    Posts
    58
    Database is DB2 v9.1 on AIX 5.3

    After we did a bind on all stored procedures and application, the problem is resolved.

    Thank you very much for your help!

Posting Permissions

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