SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table.
Explanation: One of the following conditions is true:
No data was retrieved, updated, or deleted.
User Response: No action is required. Processing can continue.
sqlcode: +100
sqlstate: 02000
SQL0101N The statement is too long or too complex.
Explanation: The statement could not be processed because it exceeds a system limit for either length or complexity, or because too many constraints or triggers are involved.
If the statement is one that creates or modifies a packed description, the new packed description may be too large for its corresponding column in the system catalogs.
Federated system users should also check to see if the statement:
The statement cannot be processed.
Note: | Where character data conversions are performed for applications and databases running under different codepages, the result of the conversion is exceeding the length limit. |
User Response: Either:
sqlcode: -101
sqlstate: 54001
SQL0102N The string constant beginning with "<string>" is too long.
Explanation: One of the following has occurred:
It may be that data conversion is occurring and the resultant string is too long. For connections between applications and databases running under different codepages, string constants are converted from the application codepage to the database codepage. In certain situations, graphic string constants may be further converted from the database codepage to a UCS-2 (UNICODE) encoding, for example when the database has been created with an EUC codepage. This means that it is possible to have a resultant string which is longer than the input string.
The statement cannot be processed.
User Response: For Comment on Table or Comment on Column, reduce the size of the comment. For the SQL CONNECT statement, reduce the length of the application server name. For other string constants, the requested function is not available interactively. For an error occurring in the context of a non-CONNECT SQL statement embedded in an application program, assign the long string to a host variable and substitute that variable for the string literal in the SQL statement.
Federated system users: for a pass-through session, determine what data source is causing the error (see the problem determination guide for the failing data sources). Examine the SQL dialect for that data source to determine which specific limit has been exceeded, and adjust the failing statement as needed.
sqlcode: -102
sqlstate: 54002
SQL0103N The numeric literal "<literal>" is not valid.
Explanation: The indicated "<literal>" begins with a digit but is not a valid integer, decimal, or floating point literal.
Federated system users: a data source-specific literal representation error has occurred in a pass-through session.
The statement cannot be processed.
User Response: Correct the invalid numeric literal. Federated system users, if the error occurred in a pass-through session, determine what data source is causing the error (see the problem determination guide for the failing data sources). Examine the SQL dialect for that data source to determine which literal representation rule has been violated, and adjust the failing statement as needed.
sqlcode: -103
sqlstate: 42604
SQL0104N An unexpected token "<token>" was found following "<text>". Expected tokens may include: "<token-list>".
Explanation: A syntax error in the SQL statement was detected at the specified token following the text "<text>". The "<text>" field indicates the 20 characters of the SQL statement that preceded the token that is not valid.
As an aid to the programmer, a partial list of valid tokens is provided in the SQLERRM field of the SQLCA as "<token-list>". This list assumes the statement is correct to that point.
The statement cannot be processed.
User Response: Examine and correct the statement in the area of the specified token.
sqlcode: -104
sqlstate: 42601
SQL0105N The string constant beginning with "<string>" is not valid.
Explanation: The statement contains a string constant beginning with "<string>" that is not valid.
The statement cannot be processed.
User Response: Specify the correct format of the string constant. Check for graphic string, paired delimiters, and an even number of bytes within the string.
Federated system users, see the problem determination guide to determine which data source is causing the error.
sqlcode: -105
sqlstate: 42604
SQL0106N SQL statement begins properly but is incomplete.
Explanation: The SQL statement was correct up to the point where no more input was found. This may be caused by failure to properly end a literal. String literals need a final quote mark.
Processing of this SQL statement has ended.
User Response: Check that the statement has all the necessary parts to complete the desired function and that all clauses are complete.
For PL/I: Check that the SQL statement is complete before the semicolon. For Assembler: Check that the continuation rules are properly followed. (A nonblank character must be in column 72, and continued lines must start in column 16 or beyond.)
For COBOL: Check that the SQL statement is complete before END-EXEC.
sqlcode: -106
sqlstate: 42601, 42603
SQL0107N The name "<name>" is too long. The maximum length is "<length>".
Explanation: The name returned as "<name>" is too long. The maximum length permitted for names of that type is indicated by "<length>".
The names for indexes and constraints can be a maximum length of 18 bytes. The names for columns can be a maximum length of 30 bytes. The names for tables, views and aliases can be a maximum length of 128 bytes. (This does not include any escape characters, if present.)
A maximum of 8 bytes is permitted for a schema name (object qualifier).
Host variable names must not exceed 30 bytes in length.
For the SQL CONNECT statement, an application server name of up to 18 characters in length will be accepted at pre-compilation time. However, at runtime, an application server name which is greater than 8 characters in length will cause an error.
Also, a password of up to 18 characters in length and an authorization ID of up to 8 characters in length will be accepted in the SQL CONNECT statement.
Federated system users: if in a pass-through session, a data source-specific limit might have been exceeded.
The statement cannot be processed.
Note: | Where character data conversions are performed for applications and databases running under different codepages, the result of the conversion is exceeding the length limit. |
User Response: Choose a shorter name or correct the spelling of the object name.
Federated system users: for a pass-through session, determine what data source is causing the error (see the problem determination guide for the failing data sources). Examine the SQL dialect for that data source to determine which specific limit has been exceeded, and adjust the failing statement as needed.
sqlcode: -107
sqlstate: 42622
SQL0108N The name "<name>" has the wrong number of qualifiers.
Explanation: The name "<name>" is improperly qualified.
The object given the name "<name>" can only have one qualifier.
A column name is qualified with a table name, which is either qualified or unqualified, or a correlation name. In some contexts, a column name requires a table name qualifier.
The statement cannot be processed.
User Response: Ensure that the name for the object is qualified correctly.
sqlcode: -108
sqlstate: 42601
SQL0109N The "<clause>" clause is not allowed.
Explanation: The indicated clause is not allowed in the context where it appears in the SQL statement.
A subquery, an INSERT statement, or a CREATE VIEW statement cannot have INTO, ORDER BY, or FOR UPDATE clauses. An embedded SELECT statement cannot have ORDER BY or FOR UPDATE clauses. An embedded SELECT statement cannot contain a set operator except in a subquery. SELECT or VALUES statements used in cursor declarations cannot have an INTO clause. A RAISE_ERROR function can only be used as a select list item if it is cast to some data type using the CAST specification.
Federated system users: In a pass-through session, a data source-specific restriction might have been violated.
The statement cannot be processed.
User Response: Correct the SQL statement by removing the clause.
Federated system users: For a pass-through session, determine what data source is causing the error (see the problem determination guide for the failing data sources). Examine the SQL dialect for that data source to determine which specific restriction has been violated, and adjust the failing statement as needed.
sqlcode: -109
sqlstate: 42601
SQL0110N "<string>" is an invalid hexadecimal constant.
Explanation: The hexadecimal constant "<string>" is invalid. The problem is one of the following:
User Response: Correct the constant and resubmit the statement.
sqlcode: -110
sqlstate: 42606
SQL0111N The column function "<name>" does not include a column name.
Explanation: The specification of the column function "<name>" (AVG, MIN, MAX, SUM, or COUNT(DISTINCT)) was not specified correctly because such functions must include a column name in the operand.
The statement cannot be processed.
User Response: Specify a column name in the expression that is the operand to the column function.
NOTE: This error is only applicable to releases of DB2 prior to Version 2.
sqlcode: -111
sqlstate: 42901
SQL0112N The operand of the column function "<name>" includes a column function, a scalar fullselect, or a subquery.
Explanation: The operand of a column function cannot include a:
In a SELECT list, the operand of an arithmetic operator cannot be a column function that includes the DISTINCT keyword.
The statement cannot be processed.
User Response: Correct the use of the column function to eliminate the invalid expression and try again.
sqlcode: -112
sqlstate: 42607
SQL0117N The number of values assigned is not the same as the number of specified or implied columns.
Explanation:
The statement cannot be processed.
User Response: Correct the statement to specify one value for each of the specified or implied columns.
sqlcode: -117
sqlstate: 42802
SQL0118N The table or view that is the target of the INSERT, DELETE, or UPDATE statement is also specified in a FROM clause.
Explanation: The table or view specified as the target of an INSERT, DELETE, or UPDATE statement also appears in the FROM clause of a subquery within the statement.
The table or view that is the target of an INSERT, UPDATE, or DELETE cannot also be used to supply the values to be inserted or to qualify the rows to be inserted, updated, or deleted.
The statement cannot be processed.
This message is only applicable to Version 1.2 servers and earlier, and hosts accessed through DB2 Connect.
User Response: The implied function is not supported. To attempt to obtain the desired result, create a temporary copy of the object table or view and address the subselect to that copy.
sqlcode: -118
sqlstate: 42902
SQL0119N An expression starting with "<expression-start>" specified in a SELECT clause, HAVING clause, or ORDER BY clause is not specified in the GROUP BY clause or it is in a SELECT clause, HAVING clause, or ORDER BY clause with a column function and no GROUP BY clause is specified.
Explanation: The SELECT statement has one of the following errors:
The identified expression is an expression that starts with "<expression-start>". The expression may be a single column name.
If the NODENUMBER or PARTITION functions are specified in the HAVING clause, then all partitioning key columns of the underlying table are considered to be in the HAVING clause.
The statement cannot be processed.
User Response: Correct the statement by including the expression in the GROUP BY clause that are in the SELECT clause, HAVING clause, or ORDER BY clause or by removing the column function from the SELECT statement.
sqlcode: -119
sqlstate: 42803
SQL0120N A WHERE clause, GROUP BY clause, SET clause, or SET transition-variable statement contains a column function.
Explanation: A WHERE clause can contain a column function only if that clause appears within a subquery of a HAVING clause and the argument of the column function is a correlated reference to a group. A GROUP BY clause can contain a column function only if the argument of the column function is a correlated reference to a column in a different subselect than the one containing the GROUP BY clause. A SET clause of an UPDATE statement or a SET transition-variable statement can only include a column function within a fullselect on the right hand side of an assignment.
The statement cannot be processed.
User Response: Change the statement so that the column function is not used or used only where it is supported.
sqlcode: -120
sqlstate: 42903
SQL0121N The column "<name>" is specified more than once in the INSERT, UPDATE or SET transition-variable statement.
Explanation: The same column "<name>" is specified more than once in the list of columns of an INSERT statement, the left hand side of assignments in the SET clause of an UPDATE statement, or the left hand side of assignments in the SET transition-variable statement. Note that this error may occur when updating or inserting into a view where more than one column of the view is based on the same column of a base table.
The statement cannot be processed.
User Response: Correct the syntax of the statement so each column name is specified only once.
sqlcode: -121
sqlstate: 42701
SQL0122N A SELECT statement with no GROUP BY clause contains a column name and a column function in the SELECT clause, or a column name is contained in the SELECT clause but not in the GROUP BY clause.
Explanation: The SELECT statement has one of the following errors:
The column may be contained in a scalar function.
If the NODENUMBER or PARTITION functions are specified in the SELECT clause, then all partitioning key columns of the underlying table are considered to be in the SELECT clause.
The statement cannot be processed.
User Response: Correct the statement by including the columns in the GROUP BY clause that are in the SELECT clause or by removing the columns from the SELECT clause.
sqlcode: -122
sqlstate: 42803
SQL0123N The parameter in position "<n>" in the function "<name>" must be a constant or a keyword.
Explanation: The parameter in position "<n>" in the function "<name>" is not a constant when it is required to be a constant or a keyword when it is required to be a keyword.
User Response: Ensure that each argument of the function conforms to the definition of the corresponding parameter.
sqlcode: -123
sqlstate: 42601
SQL0125N The column number in the ORDER BY clause is either less than one or greater than the number of columns in the result table.
Explanation: The ORDER BY clause in the statement contains a column number that is either less than 1 or greater than the number of columns in the result table (the number of items in the SELECT clause).
The statement cannot be processed.
User Response: Correct the syntax of the ORDER BY clause so each column identifier properly identifies a column of the result table.
sqlcode: -125
sqlstate: 42805
SQL0127N DISTINCT is specified more than once.
Explanation: The DISTINCT qualifier cannot be used:
The statement cannot be processed.
User Response: This error is only applicable to releases of DB2 prior to DB2 Version 2 and hosts accessed through DB2 Connect.
sqlcode: -127
sqlstate: 42905
SQL0129N The statement contains too many table names (the maximum is 15).
Explanation: The SQL statement contains too many table names. A single SQL statement can reference up to 15 tables. Each table in any view referenced is included in this limit.
The statement cannot be processed.
User Response: Break the SQL statement into two or more simple statements with 15 or fewer table references.
This message is only applicable to Version 1.2 servers and earlier, and hosts accessed through DB2 Connect.
sqlcode: -129
sqlstate: 54004
SQL0130N The ESCAPE clause is not a single character, or the pattern string contains an invalid occurrence of the escape character.
Explanation: The escape character must be a single character no more than two bytes in length. It can only appear in the pattern string if it is followed by itself, a percent sign, or an underscore. For more information about the ESCAPE clause on the LIKE predicate, refer to the SQL Reference.
User Response: Correct the pattern string or the escape character accordingly.
sqlcode: -130
sqlstate: 22019, 22025
SQL0131N The operands of a LIKE predicate have incompatible data types.
Explanation: If the expression to the left of a LIKE or NOT LIKE is of type character, the expression to the right must be of type character.
If the expression to the left is of type graphic, the expression to the right must be of type graphic.
If the expression to the left is of type BLOB, the expression to the right must be of type BLOB.
The statement cannot be processed.
User Response: Correct the expressions of the LIKE predicate to be the same data type.
sqlcode: -131
sqlstate: 42818
SQL0132N A LIKE predicate or POSSTR scalar function is not valid because the first operand is not a string expression or the second operand is not a string.
Explanation: A LIKE predicate or POSSTR scalar function appearing in the statement is not valid because either the first operand is not a string expression or the second operand is not a string.
The operand appearing to the left of a LIKE or NOT LIKE predicate or the first operand of POSSTR must be a string expression. The value appearing to the right of the predicate or the second operand of POSSTR can be one of:
with the restrictions that:
A LIKE predicate or POSSTR scalar function cannot be used with DATE, TIME, or TIMESTAMP.
The statement cannot be processed.
User Response: Check and correct the syntax of LIKE and POSSTR
sqlcode: -132
sqlstate: 42824
SQL0134N Improper use of a string column, host variable, constant, or function "<name>".
Explanation: The use of the string "<name>" is not permitted.
An expression resulting in a string data type with a maximum length greater than 254 bytes is not permitted in:
An expression resulting in a LONG VARCHAR or LONG VARGRAPHIC data type is not permitted in:
Federated system users: in a pass-through session, a data source-specific restriction can cause this error. See the SQL Reference documentation for the failing data sources.
The statement cannot be processed.
User Response: The requested operation on the string is not supported.
Note: | If it is unclear as to how the 254 byte limit is being exceeded, consider that codepage conversion operations may be required to evaluate the string expression. Depending on the source and target codepages, the target may have a greater length attribute than the source. For more information, refer to the SQL Reference for discussions on string restrictions and string conversions. |
sqlstate: 42907
SQL0135N The input for a long string column in an INSERT statement or UPDATE statement must be from a host variable or be the keyword NULL.
Explanation: The UPDATE or INSERT is using constants, column names, or subqueries where it should be using NULL or a host variable.
A long string column is either a LONG VARCHAR, LONG VARGRAPHIC, VARCHAR(n) where n is greater than 254 but less than or equal to 32767, or VARGRAPHIC(n) where n is greater than 127 but less than or equal to 16383.
User Response: Refer to the DB2 for VM Application Programming manual for information on the use of long strings. Correct the statement. Try again.
sqlcode: -135
sqlstate: 56033
SQL0137N The length resulting from "<operation>" is greater than "<maximum value>".
Explanation: The result of concatenating the given operands was longer than what is supported by the result type.
Character string results are limited to 32,700 bytes unless one of the operands is a CLOB and then the limit is 2 gigabytes.
Graphic string results are limited to 16,350 characters unless one of the operands is a DBCLOB and then the limit is 1,073,741,823 (1 less than 1 gigabyte) double byte characters.
Binary string results (operands are BLOB) are limited to 2 gigabytes.
User Response: Ensure that the sum of the lengths of the operands does not exceed the supported maximum and try the operation again.
sqlcode: -137
sqlstate: 54006
SQL0138N The second or third argument of the SUBSTR function is out of range.
Explanation: One of the following conditions occurred:
M is the length of the first argument if it is fixed length or the maximum length of the first argument if it is varying length. N is the value of the second argument.
The statement cannot be processed.
User Response: Ensure that the second and third arguments of the SUBSTR function have values that conform to the above rules.
sqlcode: -138
sqlstate: 22011
SQL0139W A redundant clause appears in the specification for column "<column>".
Explanation: The clause in the column specification is redundant.
The statement was processed successfully, but the redundant clause was ignored.
User Response: Correct the column specification.
sqlcode: +139
sqlstate: 01589
SQL0142N The SQL statement is not supported.
Explanation: An embedded SQL statement that may be valid for other IBM relational database products is not supported by the database manager.
Federated system users: check to see if an SQL statement was directed at a data source that does not support the SQL statement.
The statement cannot be processed.
User Response: Change the syntax of the SQL statement or remove the statement from the program.
Federated system users: if the reason is unknown, isolate the problem to the data source failing the request (see the problem determination guide for procedures to follow to identify the failing data source) and examine the SQL dialect for that data source.
SQL0143W The SQL statement is not supported; invalid syntax is ignored.
Explanation: An embedded SQL statement that may be valid for other IBM relational database products is understood but is not supported by the database manager.
The statement may produce inconsistent or unwanted results.
User Response: Change the syntax of the SQL statement or remove the statement from the program.
SQL0150N The view or summary table in the INSERT, DELETE, or UPDATE statement is a view or summary table for which the requested operation is not permitted.
Explanation: The view or summary table named in the INSERT, UPDATE, or DELETE statement is defined so that the requested insert, update, or delete operation cannot be performed.
A view is read only if the SELECT statement contains any of the following:
Note that these conditions do not apply to subqueries of the SELECT statement.
Summary tables do not allow the insert, update or delete operations.
The statement cannot be processed.
User Response: The requested function cannot be performed on the view or summary table.
Federated system users: if the reason is unknown, isolate the problem to the data source failing the request (see the problem determination guide for procedures to follow to identify the failing data source) and examine the object definition and the update restrictions for that data source.
sqlcode: -150
sqlstate: 42807
SQL0151N The column "<name>" cannot be updated.
Explanation: The specified column cannot be updated because one of the following was attempted.
Federated system users should check to see if some other data source specific limitation prevents the column from being updated.
The statement cannot be processed.
User Response: The requested function is not supported. For a list of updateable catalogs (and the updateable columns) see the SQL Reference.
Federated system users: if the reason is unknown, isolate the problem to the data source failing the request (see the problem determination guide) and examine the object definition and the update restrictions for that data source.
sqlcode: -151
sqlstate: 42808
SQL0153N The CREATE VIEW statement or common table expression does not include a column list.
Explanation: A column list must be specified in a CREATE VIEW statement or a common table expression when:
The statement cannot be processed. For a CREATE VIEW statement, the view was not created.
User Response: Provide a column name list in the CREATE VIEW statement or common table expression or name the columns in the SELECT list of the fullselect using the AS clause.
sqlcode: -153
sqlstate: 42908
SQL0155N A trigger transition table cannot be modified.
Explanation: The trigger includes a REFERENCING clause with an OLD_TABLE or NEW_TABLE identified. A DELETE, INSERT or UPDATE triggered SQL statement has used the name specified as the OLD_TABLE or NEW_TABLE as the table to modify.
User Response: Remove the DELETE, INSERT or UPDATE triggered SQL statement from the triggered action or change the name of the transition table so that it does not conflict with the table you are attempting to modify.
sqlcode: -155
sqlstate: 42807
SQL0156N The name used for this operation is not a table.
Explanation: The SQL statements ALTER TABLE, DROP TABLE, SET CONSTRAINTS, CREATE TRIGGER, CREATE INDEX, LOCK TABLE, and RENAME TABLE are applicable only to tables, not to views. The RUNSTATS and LOAD utilities are also applicable only to tables, not to views.
Federated system users: Some utilities and statements are not supported in a federated environment. See the Administration Guide for more information.
The statement or utility cannot be processed.
User Response: Verify that the correct table name is specified in the statement. If an alias name was supplied, ensure that the alias resolves to a table.
Federated system users: Verify that the object is not a nickname.
sqlcode: -156
sqlstate: 42809
SQL0157N "<name>" is not allowed in a FOREIGN KEY clause because it identifies a view.
Explanation: The view "<name>" was identified in a FOREIGN KEY clause of a CREATE or ALTER TABLE statement. A FOREIGN KEY clause must identify a table, not a view.
The statement cannot be processed. The specified table is not created or altered.
User Response: Correct the statement to specify a table name in the FOREIGN KEY clause.
If an alias name was supplied, ensure that the alias resolves to a table.
sqlcode: -157
sqlstate: 42810
SQL0158N The number of columns specified for "<name>" is not the same as the number of columns in the result table of the associated fullselect.
Explanation: The identifier "<name>" could identify:
The number of column names specified must be equal to the number of columns in the result table of the associated fullselect.
The statement cannot be processed.
User Response: Correct the syntax so that the list of column names that immediately follow "<name>" specify a name for each column of the result table in the associated fullselect.
sqlcode: -158
sqlstate: 42811
SQL0159N The statement references "<object>" which identifies a(n) "<object-type>" rather than a(n) "<expected-object-type>".
Explanation: The object "<object>" specified as part of the statement or command refers to an object of type "<object-type>" instead of the expected type "<expected-object-type>".
The type of the object provided with the statement or command must match the type identified by "<expected-object-type>". For example, if the statement is DROP ALIAS PBIRD.T1, then PBIRD.T1 must be an alias name.
User Response: Change the statement or command to properly match the type of object identified by "<expected-object-type>".
sqlcode: -159
sqlstate: 42809
SQL0160N The WITH CHECK OPTION clause is not valid for the specified view.
Explanation: The WITH CHECK OPTION clause cannot be used in a view definition if:
Federated system users: the WITH CHECK option is not supported on views that reference updateable nicknames.
The statement cannot be processed. The specified view was not created.
User Response: Remove the WITH CHECK OPTION clause or change the view definition so it conforms to the rules above.
sqlcode: -160
sqlstate: 42813
SQL0161N The resulting row of the INSERT or UPDATE does not conform to the view definition.
Explanation: The WITH CHECK OPTION clause was specified in the view definition that is the object of the INSERT or UPDATE statement. Consequently, all attempts to insert or update rows in that view are checked to ensure that the results conform to the view definition.
The statement cannot be processed. No inserts or updates are performed, and the contents of the view and underlying base table remain unchanged.
User Response: Examine the view definition to determine why the requested INSERT or UPDATE was rejected. Note that this may be a data-dependent condition.
Requested INSERT or UPDATE may be trying to put out of range value(s) in the target column(s). For system catalog updates, see the SQL Reference for valid ranges of values in various updateable columns of catalogs.
Federated system users, if the reason is unknown, isolate the problem to the data source failing the request (see the problem determination guide) and examine the object definition and the view definition for that data source.
sqlcode: -161
sqlstate: 44000
SQL0170N The number of arguments for function "<name>" is incorrect.
Explanation: The specified scalar function "<name>" has either too few or too many arguments.
The statement cannot be processed.
User Response: Ensure that the correct number of arguments is specified for the scalar function.
sqlcode: -170
sqlstate: 42605
SQL0171N The data type, length or value of argument "<n>" of function "<name>" is incorrect.
Explanation: The data type, length or value of argument "<n>" of scalar function "<name>" is incorrect.
The statement cannot be processed.
User Response: Ensure the arguments of the scalar function conform to the function rules.
sqlcode: -171
sqlstate: 42815
SQL0172N "<name>" is not a valid function name.
Explanation: The SQL statement includes an unknown scalar function.
The statement cannot be processed.
User Response: Ensure that you correctly spell the function name.
sqlcode: -172
sqlstate: 42601
SQL0176N The second, third or fourth argument of the TRANSLATE scalar function is incorrect.
Explanation: The statement is not correct for one or more of the following reasons:
The statement cannot be processed.
User Response: Ensure that the second, third, and fourth arguments of the translate scalar function have correct values.
sqlcode: -176
sqlstate: 42815
SQL0180N The syntax of the string representation of a datetime value is incorrect.
Explanation: The string representation of a date, time, or timestamp value does not conform to the syntax for the specified or implied data type.
The statement cannot be processed.
User Response: Ensure that the syntax of the date, time, or timestamp value conforms to the syntax for its data type. If the string is not intended to be a date, time, or timestamp value, ensure that when used, it does not imply that data type.
Federated system users: the problem might be due to a date/time representation problem at the data source. If the reason is unknown, isolate the problem to the data source failing the request problem determination guide and examine the date/time representation restrictions for that data source.
sqlcode: -180
sqlstate: 22007
SQL0181N The string representation of a datetime value is out of range.
Explanation: The string representation of a date, time or timestamp value contains a value that is out of range.
This error could be caused by accessing a datetime value from an application using a country code whose datetime format is different than the one used by the application that created it. For example, a string datetime value stored in the format dd/mm/yyyy will not be valid when read by an application expecting its format to be mm/dd/yyyy.
The correct ranges for date, time, or timestamp values are as follows:
Federated system users: the problem might be due to a date/time representation problem at the data source. Refer to the data source's documentation for the ranges for date and time values at the data source. If the reason is unknown, isolate the problem to the data source failing the request (see the problem determination guide) and examine the date/time representation restrictions for that data source.
The statement cannot be processed.
User Response: Ensure that the value is within the valid range, and the application's datetime format is the same as the string value.
sqlcode: -181
sqlstate: 22007
SQL0182N An expression with a datetime value or a labeled duration is not valid.
Explanation: The specified expression contains an improperly used date, time, or timestamp value or labeled duration.
The statement cannot be processed.
User Response: Examine the SQL statement to determine the cause of the problem and correct the statement.
sqlcode: -182
sqlstate: 42816
SQL0183N A datetime arithmetic operation or datetime scalar function has a result that is not within the valid range of dates.
Explanation: The result of an arithmetic operation is a date or timestamp duration which is outside the range 0001-01-01 through 9999-12-31.
The statement cannot be executed.
User Response: Examine the SQL statement to determine the cause of the problem. If the problem is data-dependent, examine the data processed when the error occurred.
sqlcode: -183
sqlstate: 22008
SQL0187N A reference to a current date/time special register is invalid.
Explanation: An error indication from the operating system was detected while retrieving date/time information.
User Response: Ensure that the system TOD clock and timezone settings are correct.
sqlcode: -187
sqlstate: 22506
SQL0190N In table "<table-name>", column "<column-name>" cannot be altered because the data type or length of the existing column is incompatible.
Explanation: The column "<column-name>" as currently defined in "<table-name>":
The statement cannot be processed.
User Response: If the column is not a VARCHAR data type, the data type and length cannot be changed. If the length value specified was less than the existing column length, specify a larger value.
sqlcode: -190
sqlstate: 42837
SQL0191N Error occurred because of a fragmented MBCS character.
Explanation: Possible causes:
Federated system users: this situation can also be detected by the data source.
User Response:
Federated system users: if the data is correct, isolate the problem to the data source failing the request (see the problem determination guide) and examine the DBCS restrictions of that data source. If the data appears to be correct, contact IBM service for assistance.
sqlcode: -191
sqlstate: 22504
SQL0193N In an ALTER TABLE statement, the column "<column-name>" has been specified as NOT NULL and either the DEFAULT clause was not specified or was specified as DEFAULT NULL.
Explanation: When new columns are added to a table that already exists, a value must be assigned to that new column for all existing rows. By default, the null value is assigned. However, since the column has been defined as NOT NULL, a default value other than null must be defined.
User Response: Either remove the NOT NULL restriction on the column or provide a default value other than null for the column.
sqlcode: -193
sqlstate: 42601
SQL0197N A qualified column name is not allowed in the ORDER BY clause.
Explanation: The ORDER BY clause of a fullselect that includes a set operator (UNION, EXCEPT, INTERSECT) cannot have qualified column names.
User Response: Ensure that all column names in the ORDER BY clause are unqualified.
sqlcode: -197
sqlstate: 42877
SQL0198N The statement string of the PREPARE or EXECUTE IMMEDIATE statement is blank or empty.
Explanation: The host variable that was the object of the PREPARE or EXECUTE IMMEDIATE statement either contained all blanks or was an empty string.
The PREPARE or EXECUTE IMMEDIATE could not be completed.
User Response: Correct the logic of the program to ensure that a valid SQL statement is provided in the operand of the PREPARE or EXECUTE IMMEDIATE statement before it is executed.
sqlcode: -198
sqlstate: 42617
SQL0199N The use of reserved word "<keyword>" following "<text>" is not valid. Expected tokens may include: "<token-list>".
Explanation: A syntax error in the SQL statement was detected at the point in the statement when the reserved word "<keyword>" appears following "<text>". The "<text>" field indicates the 20 characters of the SQL statement that preceded the reserved word. Clauses in the statement may be in the wrong order.
As an aid to the programmer, a partial list of valid tokens is provided in the SQLERRM field of the SQLCA as "<token-list>". This list assumes the statement is correct to that point.
The statement cannot be processed.
User Response: Examine the statement in the keyword area. Add a colon or SQL delimiter, if missing. Verify that the clauses are in the correct order. If the reserved word identified in the messages is listed as a reserved word, make the word a delimited identifier.
NOTE: This error is only applicable to releases of DB2 prior to Version 2.
sqlcode: -199
sqlstate: 42601