DB2 SQL Errors Codes and Error Messages and Warnings from Error -478 to -482

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-478, SQLSTATE=42893, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
DROP OR REVOKE ON OBJECT TYPE
required-type CANNOT BE PROCESSED
BECAUSE OBJECT object-name OF TYPE
dependent-type IS DEPENDENT ON IT
Explanation: A DROP or REVOKE statement was
issued on an object type that is a dependency for one
or more objects. An object type cannot be dropped or
revoked if another object type has a dependency on
that object type.
required-type
The type of object that is required and cannot
be dropped.
object-name
The name of the object.
dependent-type
The type of object that is dependent on the
object type that is identified by required-type.
Valid values:
v ALIAS
v CHECK CONSTRAINT (The value
object-name contains the table name)
v DATABASE
v DEFAULT (The value object-name contains
the table name)
v FUNCTION
v INDEX
v JAR
v PROCEDURE
v ROLE
v SEQUENCE
v STOGROUP
v TABLE
v TABLESPACE
v TRIGGER (for the trigger package)
v TRUSTED CONTEXT
v VIEW
The following information describes some situations
where the dependency might occur:
DROP statement
For a DROP statement, the following
dependencies might exist based on the
required-type value.
v If required-type is FUNCTION:
– Another function is sourced on this
function.
– A view uses this function.
– A trigger package uses this function.
– A table uses this function in a check
constraint or user-defined default.
– A materialized query table definition uses
this function.
v If required-type is DISTINCT TYPE:
– A column of a table is defined as this
distinct type.
– A parameter of a function is defined as
this distinct type.
– A parameter of a stored procedure is
defined as this distinct type.
– A sequence is defined with this distinct
type as the data type.
The dependency might be on one of the
generated cast functions for a distinct type.
v If required-type is JAR:
– A function or stored procedure uses this
JAR in its EXTERNAL NAME.
– Another JAR uses this JAR in its Java
path.
v If required-type is SEQUENCE:
– An SQL function is defined that
references this sequence.
– An SQL procedure is defined that
references this sequence.
– A view definition is defined that
references this sequence.
– A trigger is defined that references this
sequence.
v If required-type is ROLE:
– A trusted context uses this role.
– The role is associated with the current
thread.
– The role is the owner of the object being
dropped.
In this case, code -478 can also be issued
when revoking the privileges held by this
role. When the role privileges are revoked,
the cascading of the REVOKE statement
might encounter dependencies that prevent
the REVOKE from being successfully
processed.
REVOKE statement
For a REVOKE statement, the following
dependencies might exist based on the
required-type value.
v SYSADM is being revoked. When SYSADM
is revoked, the cascading of the REVOKE
statement might encounter dependencies
that prevent the REVOKE statement from
being successfully processed.
v If required-type is FUNCTION:
– A function that is owned by the revokee
is sourced on this function.
– A view that is owned by the revokee uses
this function.
– A trigger package that is owned by the
revokee uses this function.
– A table that is owned by the revokee uses
this function in a check constraint or
user-defined default.
– A materialized query table that is owned
by the revokee uses this function in the
definition.
– An index owned by the revokee uses this
function.
v If required-type is DISTINCT TYPE:
– A column of a table that is owned by the
revokee is defined as this distinct type.
– A parameter of a function that is owned
by the revokee is defined as this distinct
type.
– A parameter of a stored procedure that is
owned by the revokee is defined as this
distinct type.
v If required-type is JAR:
– A function or stored procedure that is
owned by the revokee uses this JAR in its
EXTERNAL NAME.
– Another JAR that is owned by the
revokee uses this JAR in its Java path.
v If required-type is PROCEDURE:
– A trigger definition that is owned by the
revokee, contains a CALL statement with
the name of this stored procedure.
v If required-type is SEQUENCE:
– An SQL function is defined that
references this sequence.
– An SQL procedure is defined that
references this sequence.
– A view definition is defined that
references this sequence.
– A trigger is defined that references this
sequence.
System action: The statement cannot be processed.
Programmer response: Remove the dependencies on
this object, and then reissue the request.
SQLSTATE: The SQLSTATE depends on the values of
required-type and dependent-type:
Values SQLSTATE
required-type: JAR
type2: FUNCTION or
PROCEDURE
46003
required-type: JAR
dependent-type: JAR
4600C
All other cases. 42893

Error: DB2 SQL Error: SQLCODE=-480, SQLSTATE=51030, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PROCEDURE procedure-name HAS
NOT YET BEEN CALLED
Explanation: The procedure identified in a DESCRIBE
PROCEDURE or an ASSOCIATE LOCATORS statement
has not yet been called within the application process
or the procedure has been called, but an explicit or
implicit commit occurred before the statement.
System action: The statement cannot be executed.
Programmer response: Correct the statements so that
the exact syntax used to specify the procedure name on
the CALL statement be the same as that on the
ASSOCIATE LOCATOR and/or DESCRIBE
PROCEDURE. If an unqualified name is used to CALL
the procedure, the 1-part name must also be used on
the other statements. If the CALL statement is made
with a 3-part name, and the current server is the same
as the location in the 3-part name, the ASSOCIATE
LOCATOR or DESCRIBE procedure can omit the
location. Rerun the statements.
SQLSTATE: 51030

Error: DB2 SQL Error: SQLCODE=-482, SQLSTATE=51030, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE PROCEDURE procedure-name
RETURNED NO LOCATORS
Explanation: The procedure identified in an
ASSOCIATE LOCATORS statement returned no result
set locators.
System action: The statement cannot be executed.
Programmer response: Determine if result set locators
are returned from the identified procedure by using the
DESCRIBE PROCEDURE statement.
SQLSTATE: 51030

Above are list of DB2 SQL Errors and Warnings from Error -478 to -482 received while performing certain operation against DB2 Database or related products.

SQLCODE – Regardless of whether the application program provides an SQLCA or a stand-alone variable, SQLCODE is set by DB2 after each SQL statement is
executed. DB2 conforms to the ISO/ANSI SQL standard as follows:
If SQLCODE = 0, execution was successful.
If SQLCODE > 0, execution was successful with a warning.
If SQLCODE < 0, execution was not successful.
SQLCODE = 100, “no data” was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table.

SQLSTATE – SQLSTATE is also set by DB2 after the execution of each SQL statement. Thus, application programs can check the execution of SQL statements by testing SQLSTATE instead of SQLCODE.

Hope this was helpful.

Thanks,
SQLServerF1 Team
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.

 

Leave a Reply

Your email address will not be published. Required fields are marked *