DB2 SQL Errors Codes and Error Messages and Warnings from Error -373 to -390

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-373, SQLSTATE=42623, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
DEFAULT CANNOT BE SPECIFIED
FOR COLUMN OR SQL VARIABLE
name
Explanation: The definition or change specified for
column or SQL variable name specified DEFAULT.
DEFAULT is not supported for data type of the column
definition or SQL variable declaration.
DEFAULT is not allowed in this context for one of the
following reasons:
v A CREATE or ALTER TABLE statement attempted to
define an identity column, ROWID column, XML
column, row change timestamp column, or security
label column with the DEFAULT clause specified.
v The declaration of an SQL variable specified the
DEFAULT clause and the data type of the SQL
variable is a ROWID or XML.
v A SET statement specified DEFAULT for the value of
a ROWID column n.
System action: The statement cannot be processed.
Programmer response: Remove the DEFAULT
keyword or clause, and reissue the failing statement.
SQLSTATE: 42623

Error: DB2 SQL Error: SQLCODE=-374, SQLSTATE=428C2, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CLAUSE clause HAS NOT BEEN
SPECIFIED IN THE CREATE OR
ALTER FUNCTION STATEMENT FOR
LANGUAGE SQL FUNCTION
function-name BUT AN EXAMINATION
OF THE FUNCTION BODY REVEALS
THAT IT SHOULD BE SPECIFIED
Explanation: This message might be issued if the
following conditions apply:
v You must specify NOT DETERMINISTIC if either of
the following conditions apply within the body of
the function:
– DB2 invokes a function that has the NOT
DETERMINISTIC attribute specified.
– DB2 accesses a special register.
v You must specify MODIFIES SQL DATA if the body
of the function defined with LANGUAGE SQL can
modify SQL data or if it calls a function or a
procedure that can modify SQL data.
v You must specify READS SQL DATA if the body of
the function defined with LANGUAGE SQL contains
a subselect, or if it invokes a function that can read
SQL data.
v You must specify EXTERNAL ACTION if the body
of the function defined with LANGUAGE SQL
invokes a function that has the EXTERNAL ACTION
attribute specified.
System action: The statement cannot be executed.
Programmer response: Specify the correct clause or
change the function of the body.
SQLSTATE: 428C2

Error: DB2 SQL Error: SQLCODE=-390, SQLSTATE=42887, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE FUNCTION function-name,
SPECIFIC NAME specific-name, IS NOT
VALID IN THE CONTEXT WHERE IT
IS USED
Explanation: A function resolved to a specific function
that is not valid in the context where it is used. If
specific-name is an empty string, then the function
resolved to the built-in function identified by
function-name. Some of the possible situations include:
v A scalar or aggregate function is referenced where
only a table function is allowed (such as in the
FROM clause of a query).
v A table function is referenced where only a scalar or
aggregate function is allowed (such as in an
expression, or in a SOURCE clause of a CREATE
FUNCTION statement).
v Function SYSFUN.DSN_XMLVALIDATE invoked
outside of the required context of the first argument
to function XMLPARSE, or an option other than
STRIP WHITESPACE was specified. In this case, the
specific-name token is an empty string.
System action: The statement cannot be executed.
Programmer response: Ensure that the correct
function name and arguments are specified and that
the SQL path includes the schema where the correct
function is defined. You may need to change the
function name, arguments, SQL path (using SET
CURRENT PATH or the PATH bind option), or change
the context in which the function is used. Refer to
chapter 2 of SQL Reference for information on the use of
functions.
SQLSTATE: 42887

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