DB2 SQL Errors Codes and Error Messages and Warnings from Error -483 to -490
Error: DB2 SQL Error: SQLCODE=-483, SQLSTATE=42885, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
IN CREATE FUNCTION FOR
function-name STATEMENT, THE
NUMBER OF PARAMETERS DOES
NOT MATCH THE NUMBER OF
PARAMETERS OF THE SOURCE
Explanation: An attempt is being made to CREATE a
user-defined function function-name which is sourced on
another function. One of the following situations has
v The SOURCE clause uses a function-name (input
parameter list) to identify the source function, and
the number of types in the list is different from the
number of parameters of the function being created.
v The SOURCE clause uses different syntax to identify
the source function, and the number of types of that
function is different from the number of parameters
of the function being created.
System action: The statement cannot be executed.
Programmer response: The number of parameters for
the SOURCE function and for the function being
created must be the same. The identification of the
SOURCE function needs to be changed to:
v fix the input parameter list
v correct the function name or function specific name
to identify the proper function.
It is also possible that the SQL path needs to be
corrected in order for correct function resolution to
Error: DB2 SQL Error: SQLCODE=-487, SQLSTATE=38001, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
object-type object-name ATTEMPTED TO
EXECUTE AN SQL STATEMENT
WHEN THE DEFINITION OF THE
FUNCTION OR PROCEDURE DID
NOT SPECIFY THIS ACTION
Explanation: A user-defined function or stored
procedure object-name was invoked and attempted to
execute SQL statements, but the function or procedure
was created with the NO SQL option.
In an environment of nested functions and procedures,
the SQL option in effect is the most restrictive one that
has been specified in the nested hierarchy of functions
an procedures. The SQL data access option in effect
does not allow for modifying data.
System action: The SQL statement cannot be executed.
Programmer response: Either use an ALTER statement
to change the definition of the function or procedure to
allow SQL statements, or remove the failing SQL
statement from the external function or procedure.
Error: DB2 SQL Error: SQLCODE=-490, SQLSTATE=428B7, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
NUMBER number DIRECTLY
SPECIFIED IN AN SQL STATEMENT
IS OUTSIDE THE RANGE OF
ALLOWABLE VALUES IN THIS
CONTEXT (minval, maxval)
Explanation: A number (number) was specified that is
not valid in the context in which it was specified. The
minimum allowed value in this context is minval. The
maximum allowed value in this context is maxval. n
must be within the range specified by minval and
maxval (minval =< n =< maxval).
System action: The statement was not executed.
Programmer response: Change the value n to a valid
value in the statement.
Above are list of DB2 SQL Errors and Warnings from Error -483 to -490 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.
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.