DB2 SQL Errors Codes and Error Messages and Warnings from Error -473 to -476

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-473, SQLSTATE=42918, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A USER DEFINED DATA TYPE
CANNOT BE CALLED THE SAME
NAME AS A SYSTEM PREDEFINED
TYPE (BUILT-IN TYPE)
Explanation: The name of a data type to be created
has an unqualified name that is the same as a
system-predefined data type. The name that you
specified is not allowed. Adding delimiters does not
make the name valid. The following names are
restricted:
BIGINT DECIMAL REF
BINARY DECFLOAT ROWID
BLOB DOUBLE SMALLINT
BOOLEAN DOUBLE
PRECISION
TIME
CHAR FLOAT TIMESTAMP
CHAR VARYING GRAPHIC VARBINARY
CHARACTER INT VARCHAR
CHARACTER
VARYING
INTEGER VARGRAPHIC
CLOB LONG
VARCHAR
XML
DATALINK LONG
VARGRAPHIC
DATE NUMERIC
DBCLOB REAL
DEC ROWID
System action: The statement could not be processed.
Programmer response: Correct the statement to use
another identifier for the name of the new user-defined
type.
SQLSTATE: 42918

Error: DB2 SQL Error: SQLCODE=-475, SQLSTATE=42866, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE RESULT TYPE type-1 OF THE
SOURCE FUNCTION CANNOT BE
CAST TO THE RETURNS TYPE type-2
OF THE USER-DEFINED FUNCTION
function-name
Explanation: In order for the CREATE FUNCTION for
a sourced user-defined function to be valid, the result
type (type-1) of the source function must be castable to
the RETURNS type (type-2) of the function being
created. There is no supported cast between these data
types. See the SQL Reference for details on casting
between data types.
System action: The statement cannot be executed.
Programmer response: Change the RETURNS data
type or the SOURCE function identified so that the
result type of the SOURCE function is castable to the
RETURNS data type.
SQLSTATE: 42866

Error: DB2 SQL Error: SQLCODE=-476, SQLSTATE=42725, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
REFERENCE TO FUNCTION
function-name WAS NAMED WITHOUT
A SIGNATURE, BUT THE FUNCTION
IS NOT UNIQUE WITHIN ITS
SCHEMA
Explanation: References to a function without a
signature are permitted, but the named function
function-name must be unique in its schema and it is
not.
Note also that in the ALTER FUNCTION, DROP
FUNCTION, COMMENT ON FUNCTION, GRANT
and REVOKE statements for EXECUTE on functions,
an unqualified reference is qualified with the default
schema, and this is the schema where the problem can
be found. In the SOURCE clause of a CREATE
FUNCTION statement, the qualification comes from the
SQL path. In this case, the first schema in the path
containing a function with this name had other
functions by the same name. Refer to SQL Reference for
rules on default schema.
System action: The statement cannot be executed.
Programmer response: Correct the reference by one of
the following:
v completing the signature
v using the SPECIFIC name of the desired function
v changing the SQL path
SQLSTATE: 42725

Above are list of DB2 SQL Errors and Warnings from Error -473 to -476 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 *