SQL0301N The value of a host variable in the EXECUTE or OPEN statement cannot be used because of its data type.
Explanation: A host variable could not be used as specified in the statement because its data type is incompatible with the intended use of its value.
This error can occur as a result of specifying an incorrect host variable or an incorrect SQLTYPE value in a SQLDA on an EXECUTE or OPEN statement.
The statement cannot be processed.
User Response: Verify that the data types of all host variables in the statement are compatible with the manner in which they are used.
sqlcode: -301
sqlstate: 07006
SQL0302N The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.
Explanation: The value of an input host variable was found to be too large for its use in the SELECT, VALUES, or prepared statement. One of the following occurred:
This error occurs as a result of specifying either an incorrect host variable or an incorrect SQLLEN value in an SQLDA on an EXECUTE or OPEN statement.
The statement cannot be processed.
User Response: Ensure that the input host variable value is the correct type and length. If the input host variables supply values to parameter markers, match values with the implied data type and length of the parameter marker.
Federated system users: for a pass-through session, determine what data source is causing the error (see the problem determination guide for procedures to follow to identify the failing data source). Examine the SQL dialect for that data source to determine which specific restriction has been violated, and adjust the failing statement as needed.
sqlcode: -302
sqlstate: 22001, 22003
SQL0303N A value cannot be assigned to a host variable in the SELECT, VALUES, or FETCH statement because the data types are not compatible.
Explanation: An imbedded SELECT or VALUES statement selects into a host variable, but the data type of the variable is not compatible with the data type of the corresponding SELECT-list or VALUES-list element. Both must be numeric, character, or graphic. For example, if the data type of the column is date or time, the data type of the variable must be character with an appropriate minimum length.
The statement cannot be processed.
User Response: Verify that the table definitions are current and that the host variable has the correct data type.
sqlcode: -303
sqlstate: 42806
SQL0304N A value cannot be assigned to a host variable because the value is not within the range of the host variable's data type.
Explanation: A FETCH, VALUES, or SELECT into a host variable list failed because the host variable was not large enough to hold the retrieved value.
The statement cannot be processed. No data was retrieved.
User Response: Verify that table definitions are current and that the host variable has the correct data type. For the ranges of SQL data types, refer to the SQL Reference.
Federated system users: for the ranges of data types that are returned from a data source, refer to the documentation for that data source.
sqlcode: -304
sqlstate: 22001, 22003
SQL0305N The NULL value cannot be assigned to a host variable in the SELECT or FETCH statement because no indicator variable is specified.
Explanation: A FETCH or embedded SELECT or VALUES operation resulted in the retrieval of a NULL value to be inserted into a host variable for which no indicator variable was provided. An indicator variable must be supplied if a column can return a NULL value.
The statement cannot be processed. No data was retrieved.
User Response: Examine the definition of the FETCH or SELECT object table or the elements of the VALUES list. Correct the program to provide indicator variables for all host variables where NULL values from those columns can be retrieved.
sqlcode: -305
sqlstate: 22002
SQL0306N The host variable "<name>" is undefined.
Explanation: The host variable "<name>" is not declared in any DECLARE SECTION.
The statement cannot be processed.
User Response: Ensure that the host variable is declared and the name spelled correctly.
SQL0307N The host variable "<name>" is already defined.
Explanation: The host variable "<name>" has already been declared in a DECLARE SECTION.
The definition is ignored. The previous definition is used.
User Response: Ensure that the host variable name is spelled correctly and the name is defined only once for each program.
SQL0308N The limit on the number of host variables has been reached.
Explanation: The limit on the number of host variables is dependent on how many will fit in the HOST_VARS column of SYSPLAN. This limit has been reached.
The remaining variable declarations are ignored.
User Response: Either simplify the program, split the program into smaller, separate programs, or do both.
SQL0309N The value of a host variable in the OPEN statement is NULL, but its corresponding use cannot be NULL.
Explanation: The value of an input host variable was found to be NULL but the corresponding use in the SELECT, VALUES, or prepared statement did not specify an indicator variable.
The statement cannot be processed.
User Response: Ensure you need a USING clause. Otherwise, ensure an indicator variable is specified only if required.
sqlcode: -309
sqlstate: 07002
SQL0310N SQL statement contains too many host variables.
Explanation: The maximum number of host variables was exceeded in the statement.
The statement cannot be processed.
User Response: Ensure the statement has fewer host variables or is less complex.
SQL0311N The length of string host variable number "<var-number>" is negative or greater than the maximum.
Explanation: When evaluated, the length specification for the string host variable, whose entry in the SQLDA is indicated by <var-number> (based at 1), was negative or greater than the maximum defined for that host variable.
The statement cannot be processed.
User Response: Correct the program to ensure that the lengths of all string host variables are not negative or that they are not greater than the maximum allowed length.
sqlcode: -311
sqlstate: 22501
SQL0312N The host variable "<host-name>" is used in a dynamic SQL statement, a view definition, or a trigger definition.
Explanation: The host variable "<host-name>" appears in the SQL statement, but host variables are not allowed in dynamic SQL statements, in the SELECT statement of a view definition, or in the triggered action of a trigger definition.
The statement cannot be processed.
User Response: Use parameter markers (?) instead of host variables for dynamic SQL statements. Do not use host variables and parameter markers in view or trigger definitions.
sqlcode: -312
sqlstate: 42618
SQL0313N The number of host variables in the EXECUTE or OPEN statement is not equal to the number of input values required.
Explanation: The number of host variables specified in the EXECUTE or OPEN statement is not the same as the number of host variables or parameter markers (?) appearing in the SQL statement.
The statement cannot be processed.
User Response: Correct the application program so the number of host variables specified in the EXECUTE or OPEN statement and the number of host variables or parameter markers in the SQL statement are the same.
sqlcode: -313
sqlstate: 07001, 07004
SQL0314N The host variable "<name>" is incorrectly declared.
Explanation: The host variable "<name>" is not declared correctly for one of the following reasons:
The variable remains undefined.
User Response: Ensure that you correctly specify only the declarations the database manager supports.
SQL0315N The host variable is incorrectly declared.
Explanation: The host variable is not declared correctly for one of the following reasons:
The variable remains undefined.
User Response: Ensure that you correctly specify only the declarations the database manager supports.
SQL0317N No END DECLARE SECTION was found after a BEGIN DECLARE SECTION.
Explanation: The end of input was reached during processing of a DECLARE SECTION.
Precompilation is terminated.
User Response: Add an END DECLARE SECTION statement to end a DECLARE SECTION.
SQL0318N An END DECLARE SECTION was found without a previous BEGIN DECLARE SECTION.
Explanation: An END DECLARE SECTION statement was found, but there was no previous BEGIN DECLARE SECTION.
The statement cannot be processed.
User Response: Enter a BEGIN DECLARE SECTION before an END DECLARE SECTION.
SQL0324N The "<usage>" variable "<name>" is the wrong type.
Explanation: Either the INDICATOR variable "<name>" is not a small integer or the STATEMENT variable "<name>" is not a character data type.
The statement cannot be processed.
User Response: Ensure that the variable is the correct type and is specified correctly.
SQL0332N There is no available conversion for the source code page "<code page>" to the target code page "<code page>". Reason code "<reason-code>".
Explanation: No conversion of data is supported from the source code page to the target code page. This error can occur under the following conditions:
The reason codes are as follows:
User Response: Possible solutions include:
AS/400 users should be aware that AS/400 CCSID 65535 is not supported. AS/400 data encoded using CCSID 65535 must be converted to a supported CCSID before it can be accessed using DB2 Connect.
Federated system users: for data source code page support, see the Installation and Configuration Supplement.
sqlcode: -332
sqlstate: 57017
SQL0334N Overflow occurred while performing conversion from codepage "<source>" to codepage "<target>". The maximum size of the target area was "<max-len>". The source string length was "<source-len>" and its hexadecimal representation was "<string>".
Explanation: During the execution of the SQL statement, a code page conversion operation has resulted in a string that is longer than the maximum size of the target object.
User Response: Modify the data to avoid the overflow condition, depending on the circumstances, by:
Note: | Automatic promotion of character or graphic string data types will not occur as part of character conversion. If the resultant string length exceeds the maximum length of the data type of the source string then an overflow has occurred. To correct this situation either change the data type of the source string or use data type casting to allow for an increase in the string length due to conversion. |
sqlstate: 22524
SQL0338N An ON clause associated with a JOIN operator is not valid.
Explanation: An ON clause associated with a JOIN operator is not valid for one of the following reasons.
The statement cannot be processed.
User Response: Correct the ON clause to reference appropriate columns or delete any subqueries or scalar fullselects.
If using full outer join ensure that all functions in the ON clause are deterministic and have no external action.
sqlcode: -338
sqlstate: 42972
SQL0340N The common table expression "<name>" has the same identifier as another occurrence of a common table expression definition within the same statement.
Explanation: The common table expression name "<name>" is used in the definition of more than one common table expressions in the statement. The name used to describe a common table expression must be unique within the same statement.
The statement cannot be processed.
User Response: Change the name of one of the common table expressions.
sqlcode: -340
sqlstate: 42726
SQL0341N A cyclic reference exists between the common table expressions "<name1>" and "<name2>".
Explanation: The common table expression "<name1>" refers to "<name2>" in a FROM clause within its fullselect and "<name2>" refers to "<name1>" in a FROM clause within its fullselects. Such forms of cyclic references are not allowed.
The statement cannot be processed.
User Response: Remove the cyclic reference from one of the common table expressions.
sqlcode: -341
sqlstate: 42835
SQL0342N The common table expression "<name>" cannot use SELECT DISTINCT and must use UNION ALL because it is recursive.
Explanation: There are two possible explanations:
The statement cannot be processed.
User Response: Remove the keyword DISTINCT from the common table expression, add the keyword ALL following UNION, or remove the recursive reference within the common table expression.
sqlcode: -342
sqlstate: 42925
SQL0343N The column names are required for the recursive common table expression "<name>".
Explanation: The recursive common table expression "<name>" must include the specification of the column names following the identifier of the common table expression.
The statement cannot be processed.
User Response: Add column names following the identifier of the common table expression.
sqlcode: -343
sqlstate: 42908
SQL0344N The recursive common table expression "<name>" has mismatched data types, lengths or code pages for column "<column-name>".
Explanation: The recursive common table expression "<name>" has a column "<column-name>" that is referred to in the iterative fullselect of the common table expression. The data type, length and code page are set based on the initialization fullselect for this column. The result of the expression for the column "<column-name>" in the iterative fullselect has a different data type, length or code page that may result in failure to assign the value for the column.
The statement cannot be processed.
User Response: Correct the column used in the fullselects of the recursive common table expression so that the initialization column matches the iterative columns.
sqlcode: -344
sqlstate: 42825
SQL0345N The fullselect of the recursive common table expression "<name>" must be the UNION of two or more fullselects and cannot include column functions, GROUP BY clause, HAVING clause, or an explicit join including an ON clause.
Explanation: The common table expression "<name>" includes a reference to itself and therefore:
The statement cannot be processed.
User Response: Change the common table expression by:
sqlcode: -345
sqlstate: 42836
SQL0346N An invalid reference to common table expression "<name>" occurs in the first fullselect, as a second occurrence in the same FROM clause, or in the FROM clause of a subquery.
Explanation: The common table expression "<name>" includes an invalid reference to itself as described by one of the following.
The statement cannot be processed.
User Response: Change one of the following:
sqlcode: -346
sqlstate: 42836
SQL0347W The recursive common table expression "<name>" may contain an infinite loop.
Explanation: The recursive common table expression called "<name>" may not complete. This warning is based on not finding specific syntax as part of the iterative portion of the recursive common table expression. The expected syntax includes:
The absence of this syntax in the recursive common table expression may result in an infinite loop. The data or some other characteristic of the recursive common table expression may allow the successful completion of the statement anyway.
User Response: To prevent an infinite loop, include the expected syntax as described.
sqlcode: +347
sqlstate: 01605
SQL0350N LOB, DATALINK, or structured type column "<column-name>" cannot be used in an index, a key, or a constraint.
Explanation: Even in cases where it would not violate the maximum size of an index, key, or constraint, a LOB column, DATALINK column, or structured type column cannot be used in an index, key or constraint. This includes a distinct type column based on a LOB or DATALINK.
The statement cannot be processed.
User Response: Remove the LOB, DATALINK or structured type column from the specification of the index, key, or constraint. An index defined on a structured type column may be defined using an index extension.
sqlcode: -350
sqlstate: 42962
SQL0351N An unsupported SQLTYPE was encountered in position "<position-number>" of the output SQLDA (select list).
Explanation: The element of the SQLDA at position "<position-number>" is for a data type that either the application requestor or the application server does not support. If the application is not using the SQLDA directly, "<position-number>" could represent the position of an element in the select list or a parameter of a CALL statement.
The statement cannot be processed.
User Response: Change the statement to exclude the unsupported data type. For a select statement, remove the names of any columns in the select-list with the unsupported data type or use a cast in the query to cast the column to a supported data type.
sqlcode: -351
sqlstate: 56084
SQL0352N An unsupported SQLTYPE was encountered in position "<position-number>" of the input list (SQLDA).
Explanation: The element of the SQLDA at position "<position-number>" is for a data type that either the application requestor or the application server does not support. If the application is not using the SQLDA directly, "<position-number>" could represent the position of an input host variable, parameter marker, or a parameter of a CALL statement.
The statement cannot be processed.
User Response: Change the statement to exclude the unsupported data type.
sqlcode: -352
sqlstate: 56084
SQL0355N The column "<column-name>", as defined, is too large to be logged.
Explanation: Large Object data types (BLOB, CLOB, and DBCLOB) may be created in sizes up to 2 gigabytes (2147483647 bytes). Logging of data values is allowed only upon objects which are less than or equal to than 1 gigabyte (1073741823 bytes) in size. Therefore, large objects greater than 1 gigabyte in size can not be logged.
User Response: Either explicitly indicate logging of data is not required, by using the NOT LOGGED phrase during column creation, or reduce the maximum size of the column to 1 gigabyte or below.
sqlcode: -355
sqlstate: 42993
SQL0357N The DB2 Data Links Manager "<name>" is not currently available. Reason code = "<reason-code>".
Explanation:
The statement requires processing on the DB2 Data Links Manager "<name>". The DB2 Data Links Manager is not currently available as indicated by the reason code.
User Response: The action depends on the reason code as follows.
sqlstate: 57050
SQL0358N Unable to access file referenced by a DATALINK value. Reason code = "<reason-code>".
Explanation: A DATALINK value could not be assigned. The possible reason codes are as follows:
User Response: The action is based on the reason code as follows.
sqlstate: 428D1
SQL0360W DATALINK values may not be valid because the table "<table-name>" is in Datalink Reconcile Pending (DRP) or Datalink Reconcile Not Possible (DRNP) state.
Explanation: DATALINK values in table "<table-name>" may not be valid because the table is either in Datalink Reconcile Pending (DRP) or Datalink Reconcile Not Possible (DRNP) state. While in either of these states, control of the files on the DB2 Data Links Manager is not guaranteed.
Statement processing continues.
User Response: Refer to the Administration Guide for information on Datalink Reconcile Pending (DRP) and Datalink Reconcile Not Possible (DRNP) states to take appropriate action.
sqlcode: +360
sqlstate: 01627
SQL0368N The DB2 Data Links Manager "<name>" is not registered to the database.
Explanation: A DATALINK value already exists that references the DB2 Data Links Manager "<name>" that is not registered to the database.
The statement cannot be processed.
User Response: Contact the database administrator to determine why the DB2 Data Links Manager is no longer registered.
sqlcode: -0368
sqlstate: 55022
SQL0370N The parameter in position "<n>" must be named in the CREATE FUNCTION statement for LANGUAGE SQL function "<name>".
Explanation: All parameters for functions defined with LANGUAGE SQL must have a parameter-name for each parameter.
The statement cannot be processed.
User Response: Include a parameter name for each parameter of the function.
sqlcode: -370
sqlstate: 42601
SQL0374N The "<clause>" clause has not been specified in the CREATE FUNCTION statement for LANGUAGE SQL function "<function name>" but an examination of the function body reveals that it should be specified.
Explanation: The following situations may be the cause of this error.
NOT DETERMINISTIC must be specified if either of the following conditions apply within the body of the function:
READS SQL DATA must be specified if the body of the function defined with LANGUAGE SQL contains a subselect or if it calls a function that can read sql data.
EXTERNAL ACTION must be specified if the body of the function defined with LANGUAGE SQL calls a function that has the EXTERNAL ACTION property.
The statement cannot be processed.
User Response: Either specify the clause or change the function body.
sqlcode: -374
sqlstate: 428C2
SQL0388N In a CREATE CAST statement for function "<function-name>", either the source "<source data type name>" and target "<target-data-type-name>" are both built-in types or they are the same type.
Explanation: One of the data types must be a user-defined type. The source type and the target type cannot be the same data type.
The statement cannot be processed.
User Response: Change the data type of either the source or the target.
sqlcode: -388
sqlstate: 428DF
SQL0389N The specific function instance "<specific name>" identified in a CREATE CAST statement either has more than one parameter, has a parameter that does not match the source data type, or returns a data type that does not match the target.
Explanation: A cast function must
The statement cannot be processed.
User Response: Either chose a different function instance, change the source data type, or change the target data type.
sqlcode: -389
sqlstate: 428DG
SQL0390N The function "<function-name>" resolved to specific function "<specific-name>" that 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:
The statement cannot be processed.
User Response: Ensure that the correct function name and arguments are specified and that the current path includes the schema where the correct function is defined. You may need to change the function name, the current path (using SET CURRENT FUNCTION PATH or the FUNCPATH bind option), or change the context in which the function is used.
sqlcode: -390
sqlstate: 42887
SQL0391N Invalid use of the row based function "<function_name>".
Explanation: The statement uses a row based function "<function_name>" that cannot be used for one of the following reasons:
The statement cannot be processed.
User Response: Remove "<function-name>" from the context where it is not allowed.
sqlcode: -391
sqlstate: 42881
SQL0392N SQLDA provided for cursor "<cursor>" has been changed from the previous fetch.
Explanation: The application is running with DB2 rules, and has requested that LOB data be returned as a LOB in one FETCH statement, and as a locator in another FETCH statement. This is not permitted.
User Response: The statement cannot be executed.
Either do not use DB2 rules, or change the application to not change the data type code from LOB to locator (or the reverse) in the SQLDA between successive fetches.
sqlcode: -392
sqlstate: 42855