IBM Books

Messages Reference


SQL0300 - SQL0399



SQL0301N The value of a host variable in the EXECUTE or OPEN statement cannot be used because of its data type.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

DataJoiner 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.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

DataJoiner users: for the ranges of SQL data types, refer to the IBM DataJoiner Application Programming and SQL Reference Supplement.

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.

Cause: 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.

Action: 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.

Cause: The host variable "<name>" is not declared in any DECLARE SECTION.

The statement cannot be processed.

Action: Ensure that the host variable is declared and the name spelled correctly.



SQL0307N The host variable "<name>" is already defined.

Cause: The host variable "<name>" has already been declared in a DECLARE SECTION.

The definition is ignored. The previous definition is used.

Action: 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.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

Cause: The maximum number of host variables was exceeded in the statement.

The statement cannot be processed.

Action: 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.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

Cause: The host variable "<name>" is not declared correctly for one of the following reasons:

The variable remains undefined.

Action: Ensure that you correctly specify only the declarations the database manager supports.



SQL0315N The host variable is incorrectly declared.

Cause: The host variable is not declared correctly for one of the following reasons:

The variable remains undefined.

Action: Ensure that you correctly specify only the declarations the database manager supports.



SQL0317N No END DECLARE SECTION was found after a BEGIN DECLARE SECTION.

Cause: The end of input was reached during processing of a DECLARE SECTION.

Precompilation is terminated.

Action: Add an END DECLARE SECTION statement to end a DECLARE SECTION.



SQL0318N An END DECLARE SECTION was found without a previous BEGIN DECLARE SECTION.

Cause: An END DECLARE SECTION statement was found, but there was no previous BEGIN DECLARE SECTION.

The statement cannot be processed.

Action: Enter a BEGIN DECLARE SECTION before an END DECLARE SECTION.



SQL0324N The "<usage>" variable "<name>" is the wrong type.

Cause: 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.

Action: 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>".

Cause: 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:

1
source and target code page combination is not supported by the database manager.

2
source and target code page combination is either not supported by the database manager or by the operating system character conversion utility on the client node.

3
source and target code page combination is either not supported by the database manager or by the operating system character conversion utility on the server node.

Action: Possible solutions include:

DataJoiner users: for DataJoiner code page support, see "National Language Support", in the IBM DataJoiner Planning, Installation, and Configuration Guide.

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>".

Cause: 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.

Action: 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.

sqlcode: -334

sqlstate: 22524



SQL0338N An ON clause associated with a JOIN operator is not valid.

Cause: An ON clause associated with a JOIN operator is not valid for one of the following reasons.

The statement cannot be processed.

Action: 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.

Cause: 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.

Action: 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>".

Cause: 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.

Action: 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.

Cause: There are two possible explanations:

The statement cannot be processed.

Action: 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>".

Cause: 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.

Action: 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>".

Cause: 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.

Action: 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, or HAVING clause.

Cause: The common table expression "<name>" includes a reference to itself and therefore:

The statement cannot be processed.

Action: 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.

Cause: The common table expression "<name>" includes an invalid reference to itself as described by one of the following.

The statement cannot be processed.

Action: Change one of the following:

sqlcode: -346

sqlstate: 42836



SQL0347W The recursive common table expression "<name>" may contain an infinite loop.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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 LOB data in position "<position-number>" of the select-list cannot be sent using DRDA protocol.

Cause: LOB data types are not defined in DRDA. Hence, LOB data or distinct types based on LOB data cannot be flowed using the DRDA protocol. "<position-number>" is the position of the element with a LOB data type in the select-list.

The statement cannot be processed.

Action: Make sure that LOB data is not being retrieved when using DRDA by excluding them in the select-list, or select smaller pieces of the LOB by using CHAR(SUBSTR(CLOB)).

sqlcode: -351

sqlstate: 56084



SQL0352N LOB data in position "<position-number>" of the input-list cannot be sent using DRDA protocol.

Cause: LOB data types are not defined in DRDA. Hence, LOB data cannot be flowed using the DRDA protocol. "<position-number>" is the position of the element with a LOB data type in the input-list.

The statement cannot be processed.

Action: Make sure that LOB data is not being sent when using DRDA by excluding them in the input-list.

sqlcode: -352

sqlstate: 56084



SQL0355N The column "<column-name>", as defined, is too large to be logged.

Cause: 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.

Action: 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 file server "<server-name>" is not currently available. Reason code = "<reason-code>".

Cause: A reference to a DATALINK value required access to the file server "<server-name>". This file server is not currently available as indicated by the reason code.

01
The file server in a DATALINK value is not available.

02
The database server, instance, or database from which the operation was attempted is not registered with the file server.

03
Restart recovery is pending or is in progress on a file server involved in the operation.

04
The file server in a DATALINK value is registered with the database but is an unknown server.

The statement cannot be processed.

Action: The action depends on the reason code as follows.

01
The file server or a communication link may be down. Wait a while and try again or check with a system administrator for the file server.

02
Register the database server, instance, or database with the file server.

03
Start the recovery on the file server or wait for the in progress recovery to complete.

04
Check that the correct server name is defined and available in the netwok.

sqlcode: -357

sqlstate: 57050



SQL0358N Unable to access file referenced by a DATALINK value. Reason code = "<reason-code>".

Cause: A DATALINK value could not be assigned for one of the following reasons.

21
DATALINK value data location format is not valid.

22
DATALINK value file server is not registered with the database.

23
DATALINK linktype value is not valid.

24
DATALINK value referenced file cannot be found on the server.

25
DATALINK value referenced file is already linked to the database.

26
DATALINK value referenced file cannot be accessed for linking. It may be a symbolic link or a file with permission bit for set user ID (SUID) on or set group ID (SGID) on.

27
DATALINK value URL or comment is too long.

28
Existing registry on the file server does not allow this file to be linked (No matching prefix on DLFM).

29
The file server does not authorize the DB2 user to link this file.

30
A link is already in progress for the file by another application.

31
File copy is not complete for the file to be unlinked.

The statement cannot be processed.

Action: The action is based on the "<reason-code>" as follows.

21
Correct the data location format.

22
Ensure that the correct file server is specified and if so have it registered to the database.

23
Correct the linktype value.

24
Check that the correct file is specified and that the file is actually on the specified file server with that name.

25
Either unlink the existing reference to the file or do not specify the file in this statement.

26
Use the actual file name, not the symblic link. If SUID or SGID is on, this file cannot be linked using a DATALINK type.

27
Reduce the length of the URL or the comment.

28
See the file server administrator to add the registration necessary to link this file.

29
See the file server administrator to get the necessary authorization.

30
Do not link this file or retry later.

31
Allow some time for the file copy to complete and retry later.

sqlcode: -358

sqlstate: 428D1



SQL0360W The DATALINK value may not be valid because the table "<table-name>" is in reconcile pending or reconcile not possible state.

Cause: DATALINK values in table "<table-name>" may not be valid because the table is either in reconcile pending or reconcile not possible state. While in either of these states control of the files on the file server is not guaranteed.

Statement processing continues.

Action: Use the DATALINK RECONCILE command or API to restore the table to normal state, if possible.

sqlcode: +360

sqlstate: 01627



SQL0368N The file server "<server-name>" is not registered to the database.

Cause: A DATALINK value already exists that references the file server "<server-name>" that is not registered to the database.

The statement cannot be processed.

Action: Contact the database administrator to determine why the file server is no longer registered.

sqlcode: -368

sqlstate: 55022



SQL0370N The parameter in position "<n>" must be named in the CREATE FUNCTION statement for LANGUAGE SQL function "<name>".

Cause: All parameters for functions defined with LANGUAGE SQL must have a parameter-name for each parameter.

The statement cannot be processed.

Action: 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.

Cause: 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.

Action: 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.

Cause: 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.

Action: 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.

Cause: A cast function must

The statement cannot be processed.

Action: 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.

Cause: 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.

Action: 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>".

Cause: The statement uses a row based function "<function_name>" that cannot be used for one of the following reasons:

The statement cannot be processed.

Action: Remove "<function-name>" from the context where it is not allowed.

sqlcode: -391

sqlstate: 42881




[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]