DB2 SQL Errors Codes and Error Messages and Warnings from Error -458 to -469

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-458, SQLSTATE=42883, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
IN A REFERENCE TO FUNCTION
function-name BY SIGNATURE, A
MATCHING FUNCTION COULD NOT
BE FOUND
Explanation: In a reference to function function-name
by signature, no matching function could be found. The
problem could be with the data type or some other
attributes of a parameter. For some data types there are
attributes in addition to data type:
v Length, precision, or scale
While it is not necessary to specify a length,
precision, or scale attribute for a data type, if one is
specified then there must be an exact match on the
corresponding specification of the parameter for the
existing function as defined in SYSPARMS.
A type of FLOAT(n) does not need to match the
defined value for n since 1<=n<=21 means REAL
and 22<=n<=53 means DOUBLE. Matching occurs
based on whether the type is REAL or DOUBLE.
However, a match on data type is sufficient.
To indicate this, an empty set of parentheses must be
specified for the data types that allow a specification
of length, precision, or scale. For example, assuming
a function exists for which a parameter was defined
as CHAR(12) on the CREATE FUNCTION statement,
a reference to that function by a signature could
specify this parameter as either CHAR(12), or
CHAR(). The CHAR() syntax provides a way to say
“don’t care about length, precision and scale
attributes in finding a matching function”.
FLOAT() cannot be used since the parameter value
indicates different data types (REAL or DOUBLE).
If, however, neither length, precision, scale, or empty
parenthesis were specified, then normal default rules
apply. For example, a specification of CHAR would
result in CHAR(1) as on the CREATE TABLE
statement. Furthermore, this implicit specification of
length, precision, or scale must exactly match the
corresponding specification of the parameter for the
existing function as defined in SYSPARMS.
v Subtype, or encoding scheme
You do not need to specify the subtype or encoding
scheme (CCSID clause) to identify an existing
function in the database. However, if a subtype or
encoding scheme is specified then there must be an
exact match on the corresponding specification of the
parameter for the existing function as defined in
SYSPARMS.
Unqualified function names:
v For ALTER FUNCTION, DROP FUNCTION,
COMMENT ON FUNCTION, GRANT and REVOKE
statements for EXECUTE on functions, an
unqualified function name is implicitly qualified
with the default schema, and this is the schema
where the function with the problem can be found.
See SQL Reference for more information on default
schema.
v In the SOURCE clause of a CREATE FUNCTION
statement, the qualification comes from the SQL
path. In this case, the is no matching function in the
entire path.
Attention:A function cannot be sourced on the
COALESCE, NULLIF, RAISE_ERROR, RID, or
VALUE built-in functions. Additionally, there are
restrictions on the way that you can source on the
COUNT, COUNT_BIG, CHAR, and STRIP built-in
functions because of some of the keywords that they
accept.
System action: The statement cannot be executed.
Programmer response: Possible responses include:
v Changing the SQL path to include the correct
schema.
v Changing the attributes of the parameters.
v Using a SPECIFIC name to refer to the function
instead of a signature.
SQLSTATE: 42883

Error: DB2 SQL Error: SQLCODE=-461, SQLSTATE=42846, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A VALUE WITH DATA TYPE
source-data-type CANNOT BE CAST TO
TYPE target-data-type
Explanation: The statement contains an implicit or
explicit CAST, but the combination of the source and
target data types is not supported. DB2 attempted to
cast a value of source-data-type to the data type
target-data-type. This combination is not supported.
Change the data type of either the source or target so
that the cast is supported. For predefined (built-in) data
types or a cast involving a user-defined distinct type,
see theSQL Reference.
System action: The statement could not be processed.
Programmer response: If an explicit CAST was
specified, correct the CAST specification to specify a
supported combination of source and target types.
SQLSTATE: 42846

Error: DB2 SQL Error: SQLCODE=-469, SQLSTATE=42886, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
SQL CALL STATEMENT MUST
SPECIFY AN OUTPUT HOST
VARIABLE FOR PARAMETER number
Explanation: DB2 received an SQL CALL statement
for a stored procedure. DB2 found the row in the
SYSIBM.SYSROUTINES catalog table associated with
the requested procedure name. However, parameter
number was identified in the SYSIBM.SYSPARMS table
as an OUT or INOUT parameter. A host variable must
be supplied on the SQL CALL statement for parameters
defined as OUT or INOUT.
number
The parameter number from the ORDINAL
field in SYSIBM.SYSPARMS.
System action: The statement cannot be executed.
Programmer response: If the SQL CALL statement is
coded incorrectly, modify the SQL application to
provide an output host variable on the SQL CALL
statement.
If the SYSIBM.SYSPARMS table contains incorrect
information, the DROP PROCEDURE and CREATE
PROCEDURE statements must be used to replace the
catalog definition for the stored procedure.
SQLSTATE: 42886

Above are list of DB2 SQL Errors and Warnings from Error -458 to -469 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 &gt; 0, execution was successful with a warning.
If SQLCODE &lt; 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 *