Data Provider for DB2 Common Errors
The Data Providers for DB2 utilize the IBM SQLCAMESSAGE stored procedure with which to return detailed error messages. To use this feature, you should configure the data source to use an EBCDIC value for Host CCSID.
The following table describes DB2 server errors that may occur along with the actions you must take to correct them.
SQLSTATE | SQLCODE | Message | Description |
---|---|---|---|
42601 | -104 | Illegal symbol. Token was not valid Unexpected token. An unexpected token <token> was found following <text>. Expected tokens may include: <token-list>. |
Reason: The server cannot execute a SQL statement that contains illegal, invalid, or unexpected symbols or tokens. Action: Verify the SQL syntax using the IBM DB2 SQL Reference for the specific IBM DB2 platform and version. Check if data consumer application is using unsupported delimited object identifiers (e.g. square brackets ([<object-name>]) as opposed to using supported delimiters (double quotes). |
42602 | -113 | INVALID CHARACTER FOUND IN: <string>, REASON CODE <reason-code>. A character that is invalid in a name has been detected. <identifier> contains a character that is not allowed or does not contain any characters. |
Reason: The server cannot process a SQL SET CURRENT SQLID statement, when the client connects to the DB2 server. Action: Verify connection information to ensure the Default Qualifier value matches the DB2 collection in which object is cataloged. For more information, see Default Qualifier. |
42802 | -117 | THE NUMBER OF VALUES ASSIGNED IS NOT THE SAME AS THE NUMBER OF SPECIFIED OR IMPLIED COLUMNS. Statement contains wrong number of values. The number of values assigned is not the same as the number of specified or implied columns or variables. |
Reason: The server cannot execute a SQL INSERT statement when the number of values specified is not the same as the number of columns in the table(s). Action: Verify that the number of columns match the objects in the SQL statement, by querying the system catalog (e.g. SYSIBM.SYSCOLUMNS) or executing a client schema query (e.g. OLE DB IDBSchemaRowsets::GetSchemas(DBSCHEMA_COLUMNS) or ADO.NET MsDb2Connection.GetSchema(Columns). |
22007 | -181 | THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE Value in date, time, or timestamp string not valid. The string representation of a datetime value is out of range. |
Reason: The server cannot execute the SQL statement where a DATETIME value is incorrectly formatted or out-of-range. Action: Verify the DATETIME values are within the supported range for year of 0001-9999, month of 1-12, day of 28/29/30/31 (depending on month and leap year), hour of 0-24 (12 for USA), minutes of 0-59, seconds of 0-59, and microseconds of 0-999999. Check connection information to ensure the DateTime As Date option is specified True to instruct the client to delete the time portion of Windows DateTime data values mapped to DB2 Timestamp data values, allowing the DB2 database to read these values as DB2 Date data values. For more information, see DateTime As Date. |
42704 | -204 | <schema>.<object> is an unidentified name. An undefined object or constraint name was detected. <name> is an undefined name. |
Reason: The server cannot execute a SQL statement that references an invalid <schema>.<object> name. Action: Verify the object name specified in the SQL statement. Check connection information to ensure the Default Qualifier value matches the DB2 collection in which object is cataloged. For more information, see Default Qualifier. |
42703 | -206 | <name> IS NOT VALID IN THE CONTEXT WHERE IT IS USED Column <name> not in specified tables. <name> is not valid in the context where it is used. |
Reason: The server cannot execute a SQL statement where a specified column name is not a column of the source or target table or view referenced I the statement. Action: Verify the column references match the objects in the SQL statement, by querying the system catalog (e.g. SYSIBM.SYSCOLUMNS) or executing a client schema query (e.g. OLE DB IDBSchemaRowsets::GetSchemas(DBSCHEMA_COLUMNS) or ADO.NET MsDb2Connection.GetSchema(Columns). |
08S01 | -360 | The host resource could not be found. Check that the Initial Catalog value matches the host resource name. | Reason: The server could not connect the client to the requested DRDA RDBNAM (Relational Database Name). Action: Verify the connection information to ensure the Initial Catalog value matches DB2 for z/OS location name, DB2 for IBM i relational database directory entry (RDBDIRE), or DB2 for Windows database name. For more information, see Initial Catalog. |
42884 | -440 | NO <routine-type> BY THE NAME <routine-name> HAVING COMPATIBLE ARGUMENTS WAS FOUND IN THE CURRENT PATH No routine was found with the specified name and compatible arguments. No authorized routine named <routine-name> of type <routine-type> having compatible arguments was found. |
Reason: The server cannot execute a SQL CALL statement that contains the wrong number of arguments, or invalid parameter data types, or references an invalid <schema>.<object> name. Action: Verify the number of arguments. Check the parameter data types. Verify the object name specified in the SQL statement. Check the connection information to ensure the Default Qualifier value matches the DB2 collection in which object is cataloged. For more information, see Default Qualifier. |
24501 | -501 | THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS NOT OPEN. Cursor <cursor name> not open. The cursor specified in a FETCH statement or CLOSE statement is not open or a cursor variable in a cursor scalar function reference is not open. |
Reason: The server cannot execute a SQL SELECT or CALL statement that requires a FETCH or CLOSE against a CURSOR that is not in an open state. Action: Verify that the application is not issuing a COMMIT or ROLLBACK, which might close the cursor. Check for previously-received return message that might indicate the server automatically closed the cursor based on a system event (for example, SQLCODE -404, -652, -679, -802, -901, -904, -909, -910, -911, -913, or -952). Verify connection information to ensure the AutoCommit option is specified True when working with some generic consumers, including SQL Server Integration Services and Distributed Query Processor, when using remote unit of work transactions. For more information, see AutoCommit. |
42501 | -551 | Not authorized to object. Not authorized to object <object-name> in <resource-name> type <resource-type>. <authorization-ID> does not have the required authorization or privilege to perform operation <operation> on object <object-name>. |
Reason: The server cannot execute a SQL SELECT or CALL statement that requires a CURSOR statement stored in a static SQL package to which the current user is not authorized. The client relies on pre-defined SQL statements in sections within DB2 Static SQL packages to support execution of SQL SELECT statements. By default, the client defines a package automatically, if the runtime user has package BIND, EXECUTE, and GRANT authority over the DB2 collection specified in the Package Collection connection property. Action: Verify connection information to ensure the Package Collection value matches DB2 collection in which HIS 2010 packages are defined for execution by current user identifier or PUBLIC. Manually create HIS 2010 packages for execution by current user ID or PUBLIC, using Data Access Tool, Data Source Wizard, Data Links, or Data Access Library. Connect to DB2 using an authorization ID that is privileged to automatically create HIS 2010 packages (CREATE, BIND and EXECUTE privileges). For more information, see Package Collection. |
42501 42602 |
-567 -567 |
<bind-type> AUTHORIZATION ERROR USING <auth-id> AUTHORITY PACKAGE = <package-name> PRIVILEGE = <privilege>. Authorization name &1 is not allowed. <authorization-ID> is not a valid authorization ID. |
Reason: The server cannot execute a SQL SELECT statement when the user account does not have permission to create or execute the required DB2 packages. Action: Verify connection information to ensure the Package Collection value matches DB2 collection in which HIS 2010 packages are defined for execution by current user identifier or PUBLIC. Manually create HIS 2010 packages for execution by current user ID or PUBLIC, using Data Access Tool, Data Source Wizard, Data Links, or Data Access Library. Connect to DB2 using an authorization ID that is privileged to automatically create HIS 2010 packages (CREATE, BIND and EXECUTE privileges). For more information, see Package Collection. |
42710 | -601 | THE NAME (VERSION OR VOLUME SERIAL NUMBER) OF THE OBJECTTO BE DEFINED OR THE TARGET OF A RENAME STATEMENT IS IDENTICAL TO THE EXISTING NAME (VERSION OR VOLUME SERIAL NUMBER) <object-name> OF THE OBJECT TYPE <object-type>. <name> in <schema> type <type> already exists. The name of the object to be created is identical to the existing name <name> of type <type>. |
Reason: The server cannot name an object when that name is already in use for another object of the same type. Action: Name the object uniquely compared to existing database objects. |
42721 | -725 | THE SPECIAL REGISTER <register> AT LOCATION <location> WAS SUPPLIED AN INVALID VALUE | Reason: The server cannot process SET CURRENT SQLID statement when it contains an invalid value for user identifier or collection name. Action: Verify connection information to ensure the Default Qualifier value matches the DB2 collection in which object is cataloged. For more information, see Default Qualifier. |
23505 | -803 | AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE THE INDEX IN INDEX SPACE <indexspace-name> CONSTRAINS COLUMNS OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS. RID OF EXISTING ROW IS X <row identifier> Duplicate key value specified. One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by <index-id> constrains table <table-name> from having duplicate values for the index key. |
Reason: The server cannot execute an INSERT or UPDATE statement against a table that is constrained by a UNIQUE INDEX where the statement would result in duplicate values. Action: Verify the data values do not violate a constraint, by querying the system catalog (e.g. SYSIBM.SYSINDEXES) or executing a client schema query (e.g. OLE DB IDBSchemaRowsets::GetSchemas(DBSCHEMA_INDEXES) or ADO.NET MsDb2Connection.GetSchema(Indexes). |
51002 | -805 | DBRM OR PACKAGE NAME <location-name>.<collection-id>.<dbrmname>.<consistency-token> NOT FOUND IN PLAN <plan-name>. REASON <reason>. SQL package <package-name> in <collection-name> not found at DRDA Server. Package <package-name> was not found. |
Reason: The server could not find the DB2 static SQL package required by the DB2 client to execute a dynamic SQL SELECT statement. Action: Verify connection information to ensure the Package Collection value matches DB2 collection in which HIS 2010 packages are defined for execution by current user ID or PUBLIC. For more information, see Package Collection. |
58004 | -901 | UNSUCCESSFUL EXECUTION CAUSED BY A SYSTEM ERROR THAT DOES NOT PRECLUDE THE SUCCESSFUL EXECUTION OF SUBSEQUENT SQL STATEMENTS. SQL system error. The SQL statement failed because of a non-severe system error. Subsequent SQL statements can be processed. (Reason <reason>.) |
Reason: The server failed to execute the current SQL statement, but subsequent SQL statements may succeed. This error may be caused by a transaction commit fails within a Distributed Unit of Work, or an update fails due to a constraint, or the SQL statement contains an invalid length (0 or beyond maximum length). Action: The user should check the reason code where available to determine if further user or administrator action is required, as well as to determine how to avoid the error by modifying the application, transaction, or command. |
57011 | -904 | UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE. REASON <reason-code>, TYPE OF RESOURCE <resource-type>, AND RESOURCE NAME <resource-name>. Resource limit exceeded. Unsuccessful execution caused by an unavailable resource. Reason code: <reason-code>, type of resource: <resource-type>, and resource name: <resource-name>. |
Reason: The server cannot execute the SQL statement because the object of the statement is unavailable. Action: Verify that the object and database are available and not in a deadlock, offline, or other unavailable state. |
57033 | -913 | UNSUCCESSFUL EXECUTION CAUSED BY DEADLOCK OR TIMEOUT. REASON CODE <reason-code>, TYPE OF RESOURCE <resource-type>, AND RESOURCE NAME <resource-name>. Row or object <object-name> in <resource-name> type <resource-type> in use. Unsuccessful execution caused by deadlock or timeout. Reason code <reason-code>. |
Reason: The server cannot execute the SQL statement because the object of the statement is unavailable. Action: Verify that the object and database are available and not in a deadlock, offline, or other unavailable state. Commit or rollback previous operation, and then disconnect from the database. Check the server reason code for more information on the state of the object (e.g. DB2 for z/OS reason code 00C90088 indicates a deadlock, whereas 00C9008E indicates a timeout. |