PLS-00707 unsupported construct or internal error [2603] When Compiling A Package With Debug And Cursor Loop (Doc ID 1208706.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 10.2.0.1 to 10.2.0.5 - Release: 10.2 to 10.2
Information in this document applies to any platform.

Symptoms

Occurs on 10.2.0.x Database server.

Error when compiling a package using DEBUG

SQL> ALTER PACKAGE DUMMY_PACKAGE_2_API COMPILE DEBUG PACKAGE;

Warning: Package altered with compilation errors.
SQL> show errors;
No errors.

SQL> select * from user_errors;

NAME TYPE SEQUENCE LINE POSITION
------------------------------ ------------ ---------- ---------- ----------
TEXT
--------------------------------------------------------------------------------
ATTRIBUTE MESSAGE_NUMBER
--------- --------------
DUMMY_PACKAGE_2_API  PACKAGE BODY 1 0 0
PLS-00707: unsupported construct or internal error [2603]
ERROR 707


Works without use of DEBUG parameter
e.g.
ALTER PACKAGE DUMMY_PACKAGE_2_API COMPILE PACKAGE;


Here is an example to demonstrate the error:

-- This is just a dummy table which we will use to get TABLE%ROWTYPE
CREATE TABLE DUMMY_TABLE_TAB(
       DUMMY_COLUMN_1 NUMBER
);
-- This is the package that contain the cursor
CREATE OR REPLACE PACKAGE DUMMY_PACKAGE_1_API AS
 
  CURSOR Dummy_Cursor RETURN DUMMY_TABLE_TAB%ROWTYPE;

END DUMMY_PACKAGE_1_API;
/

-- package body
CREATE OR REPLACE PACKAGE BODY DUMMY_PACKAGE_1_API IS

  -- This is the public cursor
  CURSOR Dummy_Cursor RETURN DUMMY_TABLE_TAB%ROWTYPE
  IS
     SELECT   *
        FROM  DUMMY_TABLE_TAB;
     
END DUMMY_PACKAGE_1_API;
/

-- This is the package that access the above public cursor
CREATE OR REPLACE PACKAGE DUMMY_PACKAGE_2_API AS
 
  PROCEDURE Dummy_Procedure;

END DUMMY_PACKAGE_2_API;
/

-- Package body
CREATE OR REPLACE PACKAGE BODY DUMMY_PACKAGE_2_API IS
  -- Just a dummy procedure to put the code
  PROCEDURE Dummy_Procedure
  IS 
  BEGIN
       -- This is where we access the public cursor
       FOR rec_ IN DUMMY_PACKAGE_1_API.Dummy_Cursor LOOP
           NULL;
       END LOOP;
  END Dummy_Procedure;

END DUMMY_PACKAGE_2_API;
/

Attempt to compile DUMMY_PACKAGE_2_API using debug to generate the error.
Note that the error can only be seen in view "USER_ERRORS".

 ALTER PACKAGE DUMMY_PACKAGE_2_API COMPILE DEBUG PACKAGE;

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms