DB2 SQL Errors Codes and Error Messages and Warnings from Error -574 to -577

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-574, SQLSTATE=42894, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE SPECIFIED DEFAULT VALUE OR
IDENTITY ATTRIBUTE VALUE
CONFLICTS WITH THE DEFINITION
OF COLUMN column-name
Explanation: The DEFAULT value specified for
column-name is not valid for one of the following
reasons:
v The value is not assignable to the column because
the constant does not conform to the format for a
constant of that data type, or the value has the
incorrect length or precision.
v A floating-point constant is specified and the column
is not a floating point data type
v A decimal constant is specified and non-zero digits
would be truncated when assigned to the column
v The value is more than 255 bytes, including quotes
for strings, introducer characters such as the X for a
hex constant, fully qualified function names, and
parentheses.
v Either the USER, or SESSION_USER, or CURRENT
SQLID special register is specified and the length
attribute of the character string column is not
sufficient to store a value that is 8 characters when
the value is expressed in CCSID 37.
v A system-generated cast function was specified and
the column is not defined with a user-defined
distinct type
v A function was specified that is not supported. A
function may only be specified when the data type is
a distinct type, and in this case the specified function
must be one of the system-generated cast functions
associated with this distinct type.
v WITH DEFAULT is specified with a value other than
NULL for a LOB column.
v A value with non-zero scale was specified for the
START WITH or INCREMENT BY option of an
identity column with the DECIMAL data type.
v A decimal floating point (DECFLOAT) constant is
specified. A decimal floating point cannot be
restricted to zero scale numbers and, as such, may
not be used in IDENTITY columns.
System action: The SQL statement cannot be executed.
Programmer response: Specify a default value that is
valid for the definition of the column.
SQLSTATE: 42894
Error: DB2 SQL Error: SQLCODE=-575, SQLSTATE=51024, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
VIEW view-name CANNOT BE
REFERENCED
Explanation: An alteration was made to a table
underlying view view-name which caused the view
definition to become invalid. The view must be
successfully regenerated with an ALTER VIEW
statement before it can be referenced in a statement
other than ALTER VIEW, GRANT, REVOKE, DROP,
COMMENT, or LABEL.
System action: The statement cannot be processed.
Programmer response: Issue an ALTER VIEW
statement to regenerate the view.
SQLSTATE: 51024
Error: DB2 SQL Error: SQLCODE=–577, SQLSTATE=38002, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
object-type object-name ATTEMPTED TO
MODIFY DATA WHEN THE
DEFINITION OF THE FUNCTION OR
PROCEDURE DID NOT SPECIFY THIS
ACTION
Explanation: The current environment does not allow
SQL statements that modify data. One of the following
situations has occurred:
v A user-defined function or stored procedure
object-name was invoked and attempted to modify
data, but the function or procedure was defined
without the MODIFIES SQL option.
v A user-defined function or stored procedure
object-name was invoked and attempted to execute a
data definition statement, but the function or
procedure was defined without the MODIFIES SQL
option.
v A function or procedure defined with READS SQL
DATA, CONTAINS SQL, or NO SQL has attempted
to invoke another function or procedure defined with
MODIFIES SQL DATA.
v A user-defined function or stored procedure
object-name was invoked and attempted to use a
NEXT VALUE expression. However, the function or
procedure was defined without the MODIFIES SQL
DATA 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
and procedures. The SQL data access option in effect
does not allow for modifying the data.
System action: The SQL statement failed.
Programmer response: Either use an ALTER statement
to change the definition of the function or procedure to
allow statements that modify data, or remove the
failing SQL statement from the external function or
procedure.
SQLSTATE: 38002

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