DB2 - Problem description
| Problem IC84312 | Status: Closed |
WHEN CREATE PACKAGE BODY GETS ERROR SQL20481N, THE ERROR MESSAGE DOES NOT IDENTIFY THE PROCEDURE THAT REFERENCES ITSELF. | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
| Problem description: | |
When you run the CREATE PACKAGE BODY command for a package body
that contains a procedure that references itself (whether
directly or indirectly), it gets an error of the following form.
SQL20481N The creation or revalidation of object
"<object-name>" would result in an invalid direct or indirect
self-reference.
The "<object-name>" in the error message is the specific name
and not the real name of the procedure.
Because the package creation has failed due to the SQL20481N
error, the specific name does not persist in the DB2 system
catalog, so it is not possible find the real name of the
procedure.
With this APAR fix the "<object-name>" in the error message is
the real name of the procedure.
The following script demonstrates the problem.
<code>
create or replace package test_self_reference
as
procedure proc1;
end@
create or replace procedure proc2
is
begin
test_self_reference.proc1();
end@
create or replace package body test_self_reference
is
procedure proc1
is
begin
proc2();
end proc1;
end@
</code>
Because of this defect the CREATE OR REPLACE PACKAGE BODY
statement gets an error like this.
SQL20481N The creation or revalidation of object
"<schema-name>.TEST_SELF_REFERENCE.SQL120119100237800" would
result in an invalid direct or indirect self-reference.
With this APAR fix the CREATE OR REPLACE PACKAGE BODY gets an
error like this instead.
SQL20481N The creation or revalidation of object
"<schema-name>.TEST_SELF_REFERENCE.PROC1" would result in an
invalid direct or indirect self-reference. | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * DB2 LUW * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to v101fp1 * **************************************************************** | |
| Local Fix: | |
| available fix packs: | |
DB2 Version 10.1 Fix Pack 1 for Linux, UNIX, and Windows | |
| Solution | |
v101fp1 and v97fp6, the SQL20481N will report routine name instead of routine specific name | |
| Workaround | |
not known / see Local fix | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 13.06.2012 03.12.2012 03.12.2012 |
| Problem solved at the following versions (IBM BugInfos) | |
9.7.FP6 | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 10.1.0.1 |
|
| 10.5.0.1 |
|