DB2 SQL Errors Codes and Error Messages and Warnings from Error -636 to -638

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-636, SQLSTATE: 56016, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
RANGES SPECIFIED FOR PARTITION
part-num ARE NOT VALID
Explanation: The ranges specified for partition
part-num are not valid for one of the following reasons
v The partitioning key values specified in the limit key
value specifications were not in either ascending or
descending order.
v All of the columns in the partitioning key are
ascending, and a constant or MINVALUE was
specified following MAXVALUE in the limit key
value specification for the partition. Once
MAXVALUE is specified, all subsequent columns
must be MAXVALUE.
v All of the columns in the partitioning key are
descending, and a constant or MAXVALUE was
specified following MINVALUE in the limit key
value specification for the partition. Once
MINVALUE is specified, all subsequent columns
must be MINVALUE.
System action: The statement cannot be executed.
User response: Correct the range partitioning
specifications in the statement for the identified
partition.
SQLSTATE: 56016

Error: DB2 SQL Error: SQLCODE=-637, SQLSTATE: 42614, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
DUPLICATE keyword KEYWORD OR
CLAUSE
Explanation: The SQL statement contains a duplicate
specification for the keyword keyword. For example:
v DEFAULT, UNIQUE, and PRIMARY can only be
specified once in a column definition.
v UNIQUE and PRIMARY cannot both be specified for
the same column definition.
v PRIMARY can only be specified once in a CREATE
TABLE statement.
v The attribute-string specified in the ATTRIBUTES
clause of the PREPARE statement cannot specify an
option more than once.
v ATTRIBUTE ENCRYPTION can only be specified
once in a TRUSTED CONTEXT definition.
v There are more than one xquery-context-item-expression
in the PASSING clause of an XMLQUERY or
XMLEXISTS.
v WHEN MATCHED and WHEN NOT MATCHED
clauses cannot be specified more than once in a
MERGE statement.
v SKIP LOCKED DATA clause cannot be specified
more than once for:
– all clauses in select-stmt
– SELECT INTO statements
– search UPDATE statements
– search DELETE statements
System action: The statement cannot be processed.
Programmer response: Correct the statement by
removing duplicate clauses.
SQLSTATE: 42614

Error: DB2 SQL Error: SQLCODE=-638, SQLSTATE: 42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
TABLE table-name CANNOT BE
CREATED BECAUSE COLUMN
DEFINITION IS MISSING
Explanation: The CREATE TABLE statement does not
contain any column definition.
System action: The SQL statement cannot be executed.
Programmer response: Add column definition to the
statement.
SQLSTATE: 42601

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