SQL0257N Raw device containers are not supported.

Explanation

An attempt was made to use raw device containers but one of the following conditions is true:

  • Raw devices are not supported on this platform.
  • Raw device containers cannot be specified via the SET TABLESPACE CONTAINERS command for auto-resize table spaces.
  • Raw device containers are not supported in a DB2 pureScale environment.

User response

In a DB2 pureScale environment:

No response is required. You cannot use raw device containers in a DB2 pureScale environment.

In environments that are not DB2 pureScale environments:

  • If creating a table space then use file containers or system-managed table spaces instead.
  • If specifying a SET TABLESPACE CONTAINERS command then use file containers instead.

sqlcode: -257

sqlstate: 42994

SQL0258N Neither container operations nor a REBALANCE can be performed while a rebalance of the table space is pending or in progress.

Explanation

One of the following conditions is true:

  1. An ALTER TABLESPACE statement involving container operations or the REBALANCE clause has previously been issued by this application or another and has yet to be committed.
  2. A rebalance is in progress.

User response

Perform the response that is appropriate to the condition:

  1. If possible, roll back the uncommitted unit of work and issue a single ALTER TABLESPACE statement to perform all of the container operations. Otherwise, wait until the rebalance has completed and then try the operation again. Note that pages cannot both be added to and removed from a table space in the same ALTER TABLESPACE statement.
  2. Wait until the rebalance has completed and then try the operation again.

sqlcode: -258

sqlstate: 55041

SQL0259N Container map for table space is too complicated.

Explanation

The map structure keeps a record of how the table space address space is mapped to the various containers. If this gets too complicated, it does not fit in the table space file.

User response

The table space may need to be rebalanced to more evenly distribute the data among the containers. This may simplify the mapping.

If this does not work, try making as many containers as possible the same size. Existing container sizes can be changed by backing up the table space and then using the database administration utility to change the containers. Restore the table space to the new containers.

sqlcode: -259

sqlstate: 54037

SQL0260N Column column-name cannot belong to either the distribution key or the table partitioning key because it is either a LONG column, DATALINK column, XML column, or structured type column.

Explanation

Neither the distribution key nor the table partitioning key can have a LONG column, DATALINK column, XML column, or structured type column.

The statement cannot be processed.

User response

Do not use LONG columns, DATALINK columns, XML columns, or structured type columns for either the distribution key or the table partitioning key.

If the table needs to be distributed and only has LONG columns, DATALINK columns, XML columns, or structured type columns, either add a column that can be used for the distribution key to the table, or define the table without a distribution key in a single-partition database partition group.

If the table needs to be partitioned and only has LONG columns, DATALINK columns, XML columns, or structured type columns, either add a column that can be used for the partitioning key of the table, or define a nonpartitioned table.

sqlcode: -260

sqlstate: 42962

SQL0262N Table table-name cannot be created in the database partition group group-name because no column exists that can be used as the distribution key.

Explanation

The table table-name cannot be created in a database partition group. The table must have at least one column that can be used as the distribution key. Columns of the following data types cannot be used in a distribution key:

  • BLOB
  • CLOB
  • DATALINK
  • DBCLOB
  • LONG VARCHAR
  • LONG VARGRAPHIC
  • XML
  • Structured type
  • A user-defined data type based on any of the previously listed data types

The statement cannot be processed.

User response

Either create the table with one or more columns that can be used in a distribution key, or create the table in a single database partition group.

sqlcode: -262

sqlstate: 428A2

SQL0263N Member range from member-number-1 to member-number-2 is not valid. The second member number must be greater than or equal to the first member number.

Explanation

The specified member range is not valid.

The statement cannot be processed.

User response

Correct the member range in the statement, then try the request again.

sqlcode: -263

sqlstate: 428A9

SQL0264N Partitioning key cannot be added or dropped because table resides in a table space defined on the multi-partition database partition group name.

Explanation

You can only add or drop a partitioning key on a table in a single database partition group.

The statement cannot be processed.

User response

Do one of the following and try the request again:

  • Define an identical table with a partitioning key.
  • Redistribute the database partition group to a single database partition group.

sqlcode: -264

sqlstate: 55037

SQL0265N A duplicate member number or database partition number was detected in the list of database partition numbers.

Explanation

For the CREATE DATABASE PARTITION GROUP statement, a database partition number can only appear once in the ON DBPARTITIONNUMS clause.

For the CREATE TABLESPACE and ALTER TABLESPACE statement, a database partition number can appear only once and in only one ON DBPARTITIONNUMS clause.

For the ALTER DATABASE PARTITION GROUP statement or REDISTRIBUTE DATABASE PARTITION GROUP command, one of the following occurred:

  • The database partition number appeared more than once in the ADD DBPARTITIONNUMS or the DROP DBPARTITIONNUMS clause.
  • The database partition number appeared in both the ADD DBPARTITIONNUMS and the DROP DBPARTITIONNUMS clause.
  • The database partition number to be added is already a member of the database partition group.

The statement cannot be processed.

For a call WLM_ALTER_MEMBER_SUBSET statement, the member to be added is already a member of the member subset.

User response

Ensure that the database partition names or database partition numbers in the ON DBPARTITIONNUMS, ADD DBPARTITIONNUMS, or DROP DBPARTITIONNUMS clause are unique. For the CREATE TABLESPACE and ALTER TABLESPACE statements, ensure that a database partition number appears in no more than one ON DBPARTITIONNUMS clause.

In addition, for the ALTER DATABASE PARTITION GROUP statement or REDISTRIBUTE DATABASE PARTITION GROUP command:

  • Do not specify a database partition number in both the ADD DBPARTITIONNUMS and the DROP DBPARTITIONNUMS clause.
  • Remove the database partition number from the ADD DBPARTITIONNUMS clause if the database partition number is already defined in the database partition group.

For the call WLM_ALTER_MEMBER_SUBSET statement, remove the member number from the member list.

sqlcode: -265

sqlstate: 42728

SQL0266N The specified member number or database partition number member-number is not valid.

Explanation

The specified member number or database partition number member-number is not valid for one of the following reasons:

  • The member number or database partition number is not in the valid range of 0 to 999.
  • The member number or database partition number is not in the configuration file.
  • The member number or database partition number is not part of the database partition group, therefore the requested operation cannot be processed.
  • The statement referenced an event monitor that that is defined to run on a member that does not exist in the instance.
  • The member number specified in the WLM_ALTER_MEMBER_SUBSET statement is not in the member subset.

The statement cannot be processed.

User response

Depending on the condition:

  • Issue the statement, command or API with member numbers or database partition numbers in the valid range.
  • Follow the procedure to add a member or database partition to the system.
  • Remove the member or database partition from the specified members or database partitions in the statement, command or API.
  • Drop the event monitor referenced by the statement.
  • Re-enter the WLM_ALTER_MEMBER_SUBSET statement with a member number that exists in the member subset.

sqlcode: -266

sqlstate: 42729

SQL0268N operation cannot be performed while the database partition group is being redistributed.

Explanation

One of the following applies, as indicated by operation:
  • The database partition group is being redistributed and it cannot be altered, dropped or redistributed again until the current operation is complete.
  • The partitioning key of a table cannot be dropped while the database partition group of the table is being redistributed.
  • New objects cannot be created because REDISTRIBUTE is dropping all of the old database partitions in this database partition group.
  • New columns cannot be added through ALTER TABLE, because REDISTRIBUTE is dropping all of the old database partitions in this database partition group.

The statement cannot be processed.

User response

Wait until the redistribution is complete, then try the request again.

sqlcode: -268

sqlstate: 55038

SQL0269N Database contains maximum number of partitioning maps.

Explanation

Because the database contains the maximum number of partitioning maps (32,768), you cannot create a new database partition group, alter a database partition group, or redistribute an existing one.

The statement cannot be processed.

User response

Drop one or more database partition group in the database.

Note: Dropping a database partition group drops all database objects such as table spaces, tables and views that reside in the database partition group.

sqlcode: -269

sqlstate: 54033

SQL0270N Function not supported (Reason code = reason-code).

Explanation

The statement cannot be processed because it violates a restriction as indicated by the following reason code:

1

The primary key, each unique constraint, and each unique index must contain all distribution columns of the table.

2

Updating the distribution key column value is not supported.

3

A foreign key cannot include any nullable distribution key columns when defined with ON DELETE SET NULL. This is a special case of reason code 2 because defining such a constraint would result in attempting to update a distribution key column.

5

Views created with the WITH CHECK OPTION clause should not use functions (or reference views that use functions) that:

  • are non-deterministic
  • have side effects
  • are related to the placement of data, for example, nodenumber or partition functions

These functions must also not be present within a referenced view if the new view is created with the CASCADED check option.

6

A transform cannot be defined for a user-defined distinct type.

7

Long fields can only be defined using a table space with a page size that is 4 KB. A LARGE TABLESPACE can only be created using a 4 KB page size.

8

Structured types are not supported as columns of a table or structured type attribute data types prior to DB2 Version 7.1.

9

Triggers are not supported on typed tables.

10

A single default table space cannot be selected because the table has one or more LOB columns that must be placed in a table space with a 4 KB page size and the rowsize or number of columns in the table requires a table space with an 8 KB page size.

11

A typed table or typed view cannot be created using a structured type that has no attributes.

12

The type of a source key parameter must be a user-defined structured type or a distinct type that is not sourced on the LOB, XML, LONG VARCHAR, or LONG VARGRAPHIC data type.

13

Check constraints cannot be defined on a typed table or the WITH CHECK OPTION clause cannot be specified on a typed view.

14

Referential constraints cannot be defined on a typed table or to a parent table that is a typed table.

15

A default value cannot be defined for reference type columns.

16

A reference data type or structured data type cannot be used as a parameter data type or a returns data type of a user-defined function prior to DB2 UDB Version 7.1. Otherwise, a scoped reference data type or an array data type cannot be used as a parameter data type or returns data type of a routine. A structured data type or an array data type cannot be used as a return column of a table or row function.

17

The SET INTEGRITY statement cannot be used for a typed table.

18

Column-level UPDATE and REFERENCES privileges cannot be granted on a typed table, typed view, or nickname.

19

A default value must be specified when defining a default for a column of a typed table.

20

ALTER TABLE is not supported for a materialized query table.

21

A column cannot be dropped or have its length, data type, security, nullability, or hidden attribute altered on a table that is a base table for a materialized query table.

22

Materialized query tables cannot be defined in a CREATE SCHEMA statement.

23

REPLICATED can be specified only for a materialized query table defined with REFRESH DEFERRED.

24

The triggered-action in a BEFORE trigger cannot reference a materialized query table defined with REFRESH IMMEDIATE.

25

Only one materialized query table can be specified for a SET INTEGRITY statement.

26

The database partition group being redistributed contains at least one replicated materialized query table.

27

A replicated materialized query table cannot be defined on a table that does not have a unique index existing on one or more columns that make up the replicated materialized query table.

28

A typed table or materialized query table cannot be renamed.

29

The FOR EXCEPTION clause cannot be specified with a materialized query table in the SET INTEGRITY statement.

30

Typed tables and typed views cannot be defined in a CREATE SCHEMA statement.

31

A distribution key cannot be defined with more than 500 columns.

32

A table defined using a multipartition database partition group or a single-partition database partition group on other than the catalog partition does not support DATALINK columns defined with FILE LINK CONTROL.

33

An underlying table of a materialized query table defined with REFRESH IMMEDIATE cannot be the child of a referential constraint with a cascading effect (that is, with the option ON DELETE CASCADE or ON DELETE SET NULL).

34

The underlying object relational feature is not supported in the current release.

35

A sequence or an identity column cannot be created in a Version 7 multinode database environment.

36

Activation of a multinode Version 7 database that contains sequences or identity columns is not allowed.

38

An index using an index extension is not supported in a multiple partition database partition group prior to DB2 UDB Version 8.1 FixPak 6.

39

Nicknames or OLE DB table functions cannot be referenced directly or indirectly in the body of an SQL function or SQL method.

40

The function IDENTITY_VAL_LOCAL cannot be used in a trigger or SQL function.

41

A single SQL variable statement cannot assign values to both a local variable and a transition variable.

42

The execution of a trigger, method, or function using SQL control statements and the execution of a dynamic compound statement in a multinode database are not allowed.

43

One or more of the specified options are currently not supported.

44

The following EXPLAIN MODES are not supported in MPP, SMP, and Data Joiner:

  • COUNT CARDINALITIES
  • COMPARE CARDINALITIES
  • ESTIMATE CARDINALITIES
45

APPEND mode is not supported for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

46

INPLACE table reorganization is not supported for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

47

Index extensions are not supported for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

48

Changes to the dimension specification of a multidimensional clustering (MDC) table are not supported.

49

Clustering indexes are not supported for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

50

A user-defined temporary table cannot be a multidimensional clustering (MDC) or insert time clustering (ITC) table.

51

Issuing DDL operations that affect expression-based indexes from a database partition that is not the catalog database partition is not supported.

52

The expression of a generated column cannot be modified or added to a column that was not generated using an expression if that column is a distribution key column or was used in the ORGANIZE BY clause, the PARTITION BY clause, or the DISTRIBUTE BY clause.

53

A column with a LONG VARCHAR, LONG VARGRAPHIC, LOB, or XML type, a distinct type on any of these types, or a structured type cannot be specified in the select-list of a scrollable cursor.

54

INPLACE table reorganization is not supported for the specified system catalog table.

55

Federated database system support and the concentrator feature cannot be active at the same time.

56

Online index reorganization in rebuild mode is not supported for spatial indexes in ALLOW WRITE mode.

57

Online index reorganization is supported on multi-dimensionally clustered (MDC) or insert time clustering (ITC) tables in ALLOW WRITE mode only when the CLEANUP option or RECLAIM EXTENTS option is specified.

58

For a Version 8 database: the XML data type can be used only as a transient data type and cannot be stored in the database nor returned to an application.

59

A function or method that contains SQL statements cannot be used in a partitioned database environment.

60

The ALTER TABLE ALTER COLUMN SET INLINE LENGTH statement is not allowed because there is an object of type VIEW, either typed or untyped, that depends on the typed table.

61

A text search function cannot be used in the expression for check constraints or generated columns.

62

The WITH CHECK OPTION clause cannot be used with views that reference text search functions directly or depend on other views referencing text search functions.

63

A column with a LOB type, distinct type on a LOB type, A column with a LONG VARCHAR, LONG VARGRAPHIC, DATALINK, LOB, XML type, distinct type on any of these types, or structured type cannot be specified in the select-list of an insensitive scrollable cursor.

64

Federated processing is not supported on this platform.

65

Altering the nickname local type from the current type to the specified type is not allowed.

66

The built-in transform group SYSSTRUCT is not supported.

67

Nicknames or views on nicknames cannot be specified as target in a MERGE or UPDATE statement.

68

In a partitioned database, the maximum number of distinct NEXT VALUE expressions supported in an SQL statement is 55.

69

Delete from view would cause a descendent table to be delete-connected via multiple paths to two or more tables that appear in the view definition. Either a check constraint or trigger defined on the descendent table needs to be fired according to the final result which is not guaranteed.

70

A column cannot be dropped, or have its length, data type, security, or nullability altered on a table which is a base table of a view enabled for query optimization.

71

CALL statement cannot be used in a trigger, a SQL function, a SQL method or a dynamic compound statement in a partitioned database environment.

72

A nullable column cannot be changed to become an identity column.

73

Backup images in a partitioned database environment are not allowed to include logs.

74

Updating a status field in the recovery history file by time stamp is not allowed.

75

Automatic statistics profiling is not supported on a multiple database partition system, on a system where SMP is enabled, or on a federated system.

83

For versions of DB2 database prior to V9.7, the statement cannot be processed because DATA CAPTURE CHANGES and COMPRESS YES are not compatible.

87

The following types of tables cannot be defined as partitioned tables: typed tables, staging tables, user temporary tables, and range clustered tables.

89

REORG INDEX is only supported for nonpartitioned indexes on partitioned tables or for the CLEANUP ONLY ALL option.

90

For versions of DB2 database prior to Version 9.7, the PARTITIONED clause cannot be specified on the CREATE INDEX statement because partitioned indexes are not supported.

91

For versions of DB2 database prior to V9.7, the statement cannot be processed because DATA CAPTURE CHANGES is not supported for a table that has a compression dictionary.

92

Detaching from a table that is the parent of an enforced referential integrity constraint is not allowed.

93

Detaching a partition is not allowed for partitions that contain data that was appended using LOAD INSERT, and that have dependent materialized query tables or dependent staging tables that have not been incrementally refreshed with respect to the appended data.

95

A table with an attached partition whose integrity has not been verified yet cannot be altered to be a materialized query table.

97

Altering this data type is not supported for an element of the multinode distribution key, data distribution key, or MDC organizing dimension.

98

Altering the type of an identity column is not supported.

99

An alter table set data type changed the external UDF used by a check constraint.

102

A security policy cannot be added to a typed table.

103

On database servers Version 9.5 and earlier, online index reorganization in ALLOW WRITE mode is not supported for tables with XML columns.

104

In place table REORG is not allowed if an index on an XML column is defined on the table.

105

The REORG INDEX command is supported only for block indexes in CLEANUP or RECLAIM EXTENTS mode.

106

Attaching a partition to a materialized query table is not supported.

109

A text search function cannot be applied to the text index of a partitioned table if the text search function does not directly reference the partitioned table or is a member of a sub-select that contains an OUTER JOIN clause.

110

For SECLABEL, SECLABEL_BY_NAME, and SECLABEL_TO_CHAR, the security policy name parameter must be a string constant.

111

An audit policy cannot be associated with a typed table.

112

The health monitor does not support configuration of actions and notifications on non-root installations.

113

Use of a Compound SQL (compiled) statement in the body of a trigger or SQL table function is not supported in partitioned database environments.

114

Partitioned spatial indexes are not supported.

115

The function cannot be revalidated.

116

The same name was used for more than one named parameter marker in a compound SQL (compiled) statement that is dynamically prepared or executed.

119

If a field of a ROW variable has an ARRAY type, then array element values cannot be directly retrieved by specifying the corresponding index value for the element on the ROW variable field reference.

120

An attempt was made to insert data into an unsupported type of table.

121

The period-definition of a row-organized table must not include the MAINTAINED BY USER clause.

122

The period-definition of a column-organized table must include the MAINTAINED BY USER clause.

User response

The action corresponding to the reason code is as follows:

1

Correct the CREATE TABLE, ALTER TABLE or CREATE UNIQUE INDEX statement.

2

Do not attempt to update the distribution key columns for a multipartition table, or consider deleting and then inserting the row with the new values in the distribution columns.

3

Make the distribution key column not nullable, specify a different ON DELETE action, or change the distribution key of the table so that the foreign key does not include any columns of the distribution key.

4

Either specify DATA CAPTURE NONE or ensure that the table is placed in a table space in a single-partition database partition group that specifies the catalog partition.

5

Do not use the WITH CHECK OPTION clause, or remove the function or view from the view definition.

6

Transforms are automatic for user-defined distinct types. Use the CREATE TRANSFORM statement for user-defined structured types only.

7

Use a table space with a 4 KB page size for any table that includes long fields. If you are using DMS table spaces, you can place long fields in a table space with a 4 KB page size with other table or index data in table spaces with a different page size. When defining a LARGE TABLESPACE, use PAGESIZE 4K.

8

For servers prior to DB2 UDB Version 7.1, ensure that no column data types are structured types in the CREATE TABLE statement or ALTER TYPE ADD COLUMN statement. Ensure that no attribute data types are structured types in the CREATE TYPE statement or ALTER TYPE ADD ATTRIBUTE statement.

9

Do not define triggers on typed tables.

10

Either reduce the row size or number of columns in the table or specify two table spaces such that the long data is in a table space with a 4 KB page size and the base data is in a table space with an 8 KB page size.

11

When creating a typed table or typed view, specify a structured type that has at least one attribute defined.

12

For the type of a source key parameter, use only a user-defined structured type or a distinct type that is not sourced on a LOB, XML, LONG VARCHAR, or LONG VARGRAPHIC type.

13

In a CREATE TABLE or ALTER TABLE statement for a typed table, do not specify check constraints. In a CREATE VIEW statement for a typed view, do not specify the WITH CHECK OPTION clause.

14

Do not specify referential constraints involving typed tables in a CREATE TABLE or ALTER TABLE statement.

15

Do not specify a DEFAULT clause for a column with a reference data type in a CREATE TABLE or ALTER TABLE statement.

16

For servers prior to DB2 UDB Version 7.1, do not specify a structured type parameter or returns type when creating a user-defined function. Otherwise, do not specify a scoped reference type as a parameter or returns type. Do not specify a structured type as a return column of a table or row function.

17

Do not specify a typed table in the SET INTEGRITY statement.

18

Do not include specific column names when granting REFERENCES or UPDATE privileges on a typed table, typed view, or nickname.

19

Include a specific value when specifying the DEFAULT clause on a column of a typed table.

20

Drop the materialized query table, and re-create it with the desired attributes.

21

To drop or alter a column in a table that is a base table for a materialized query table, perform the following steps:

  1. Drop the dependent materialized query table.
  2. Drop the column of the base table, or alter the length, data type, nullability, or hidden attribute of this column.
  3. Re-create the materialized query table.
22

Issue the CREATE SUMMARY TABLE statement outside of the CREATE SCHEMA statement.

23

Either remove the REPLICATED specification or ensure that REFRESH DEFERRED is specified for the materialized query table definition.

24

Remove the reference to the materialized query table in the triggered-action in the BEFORE trigger.

25

Issue separate SET INTEGRITY IMMEDIATE CHECKED statements for each materialized query table.

26

Drop all replicated materialized query tables in the database partition group, and then issue the REDISTRIBUTE DATABASE PARTITION GROUP command again. Re-create the replicated materialized query tables.

27

Ensure that a subset of the columns defined for the materialized query table also is the set of columns that make up a unique index on the base table.

28

You can change a typed table or materialized query table name only by dropping the table and creating it again with the new name. Dropping the table might have implications on other objects that depend on the table, and the privileges on the table are lost.

29

Remove the FOR EXCEPTION clause from the SET INTEGRITY statement.

30

Issue the CREATE statement for the typed view or typed table outside of the CREATE SCHEMA statement.

31

Reduce the number of columns in the distribution key.

32

Either specify NO LINK CONTROL for the DATALINK column or place the table in a table space on a single-partitioned database partition group that specifies the catalog partition. If you are redistributing data to a multiple-partition database partition group, you must drop the table to continue with the redistribute.

33

Use one of the following approaches:

  • Do not define a referential constraint with cascading effect (that is, with option ON DELETE CASCADE or ON DELETE SET NULL) on an underlying table of a materialized query table defined with REFRESH IMMEDIATE as the child.
  • Do not define a REFRESH IMMEDIATE materialized query table whose underlying table is the child of a referential constraint with cascading effect (that is, with option ON DELETE CASCADE or ON DELETE SET NULL).
34

Remove the use of any unsupported object relational features.

35

Do not create or remove the GENERATED [ALWAYS | BY DEFAULT] AS IDENTITY ... attribute.

36

Drop the new node or nodes to go back to a single node configuration. If you require more nodes, drop the sequences or tables with identity columns before adding new nodes.

38

An index using an index extension cannot be created on a table in a multiple partition database partition group. A database partition group cannot become a multiple partition database partition group while an index using an index extension exists on a table in the database partition group. Either drop any such indexes and add the partition to the database partition group, in which case the indexes cannot be re-created, or leave the database partition group unchanged.

39

Remove the reference to a nickname or OLE DB table function, or remove the reference to the object that indirectly references one of these.

40

Remove the invocation of the IDENTITY_VAL_LOCAL function from the trigger definition or the SQL function definition.

41

Split the assignment into two separate statements. One statement must assign values only to SQL variables, and the other statement must assign values only to transition variables.

42

Drop the new node or nodes to return to a single node configuration. If you require more nodes, you must drop the triggers, functions, or methods containing control statements.

43

Reissue the RUNSTATS command and turn off the unsupported option.

44

You cannot use these EXPLAIN modes in SMP, MPP, and Data Joiner environments. If possible, run the query in serial mode. Otherwise, set the EXPLAIN mode to YES or EXPLAIN to provide the same information except for the actual cardinalities.

45

Do not specify the APPEND clause in an ALTER TABLE statement for multi-dimensionally clustered (MDC) or insert time clustering (ITC) tables.

46

Reissue the REORG command without specifying the INPLACE option.

47

Do not specify the EXTENSION clause in a CREATE INDEX statement for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

48

Drop the multidimensional clustering (MDC) table and re-create it with the modified dimension specification.

49

Do not specify the CLUSTER clause in a CREATE INDEX statement for multidimensional clustering (MDC) or insert time clustering (ITC) tables.

50

Do not specify the ORGANIZE BY clause in a CREATE TABLE statement for declared global temporary tables.

51

Issue the CREATE INDEX statement from the catalog database partition.

52

Do not modify the expression or add it to an existing column. To change the composition of the PARTITIONING KEY clause, the ORGANIZE BY clause, the PARTITION BY clause, the DISTRIBUTE BY clause, or the generating expression of any of its members that are generated columns, drop and re-create the table and then repopulate it.

53

Modify the select-list of the scrollable cursor to not include a column with these types.

54

Reissue the REORG command without specifying the INPLACE option.

55

Turn off concentrator or federated database system support. Turn off the concentrator by setting the value of the database manager configuration parameter MAX_CONNECTIONS to be less than or equal to the value of the database manager configuration parameter MAX_COORDAGENTS. Turn off federated database system support by setting the FEDERATED parameter in the database manager configuration to NO.

56

Reissue the REORG INDEXES command, specifying ALLOW NONE or ALLOW READ.

57

Reissue the REORG INDEXES command, specifying ALLOW NONE or ALLOW READ.

58

For a Version 8 database: Input the XML data to one of the functions that accept XML input (ultimately XMLSERIALIZE) and store the output of the function in the database or return it to the application.

59

In a partitioned database environment, only use functions and methods defined with the NO SQL option.

60

Drop the views that depend on the typed table. Reissue the ALTER TABLE ALTER COLUMN SET INLINE LENGTH statement for the typed table, and re-create the views that you dropped.

61

Do not use the text search function in the expression for check constraints or generated columns. Use the LIKE function instead of CONTAINS, if possible.

62

Do not specify the WITH CHECK OPTION clause for this view.

63

Modify the select-list of the scrollable cursor to not include a column with these types.

64

Do not attempt federated processing on this platform.

65

Do not attempt to alter the nickname local type from the current type to the specified type.

66

Do not specify SYSSTRUCT as a transform group.

67

Do not specify a nickname or a view on nicknames as a target in a MERGE or UPDATE statement.

68

Reduce the number of distinct NEXT VALUE expressions in the statement, or change to a non-partitioned database.

69

Do not use DELETE FROM view-name.

70

Disable the views enabled for query optimization, drop or alter the column of the base table and then enable the views for query optimization.

71

In a partitioned database environment, do not use the CALL statement in a trigger, an SQL function, an SQL method, or a dynamic compound statement.

72

The column cannot become an identity column while it is nullable. To make this change, the table must be dropped and re-created with a not null column and then repopulated. Adding a new column as the identity column might also be considered.

73

Issue the BACKUP command without specifying the INCLUDE LOGS option.

74

Update the status field in the recovery history file by EID only.

75

Use one of the following approaches:

Disable automatic statistics profiling for this database by setting the database configuration parameters AUTO_STATS_PROF and AUTO_PROF_UPD to OFF.

Change the system to one that is on a single database partition, that does not have SMP enabled, and that is not federated.

83

If both DATA CAPTURE CHANGES and COMPRESS YES are being specified, you must only specify one of them. If one of DATA CAPTURE CHANGES or COMPRESS YES is being specified, you must not specify it as the other is already in effect on the table.

87

Create the table as a non-partitioned table.

89

Use the REORG INDEXES ALL command to reorganize all indexes on the table or data partition.

90

Create a nonpartitioned index by using the default or by explicitly specifying NOT PARTITIONED on CREATE INDEX.

91

Do not specify DATA CAPTURE CHANGES for this table.

92

Drop the referential constraint by using the following statement:

ALTER TABLE 'child-table'
DROP CONSTRAINT ...

Alternatively, alter the child table in the foreign key relationship so that the foreign key constraint is not enforced:

ALTER TABLE 'child-table'
ALTER FOREIGN KEY ... NOT ENFORCED

Note: The failing detach statement was executed from the parent table in the foreign key constraint, while the constraint enforcement is executed on the child table. These two tables are distinct unless the foreign key constraint is self-referential. Next, resubmit the ALTER TABLE ... DETACH PARTITION statement. You can now alter the child table to enforce the foreign key constraint:

ALTER TABLE 'child-table'
ALTER FOREIGN KEY ... ENFORCED

This will recheck the tables to ensure that the foreign key relationship is still being enforced.

93

Issue the SET INTEGRITY statement with the IMMEDIATE CHECKED option to maintain the dependent materialized query tables or dependent staging tables with respect to the data that was appended using LOAD INSERT.

95

Issue the SET INTEGRITY statement with the IMMEDIATE CHECKED or IMMEDIATE UNCHECKED option on the table to verify the integrity of the attached partition.

97

Do not alter the column data type.

98

Drop the identity attribute, alter the type, and then re-enable the identity attribute.

99

Drop the check constraint, and then re-issue the ALTER statement.

102

Do not add a security policy to a typed table.

103

On database servers Version 9.5 and earlier, reissue the REORG INDEXES command, specifying ALLOW READ ACCESS or ALLOW NO ACCESS.

104

Remove the INPLACE option and reissue the REORG TABLE command.

105

Reissue the REORG INDEX command specifying CLEANUP, or RECLAIM EXTENT, or issue REORG INDEXES ALL to reorganize all indexes (including the block indexes) for the table.

106

Issue the ALTER TABLE statement to drop the materialized query attribute from the table before attempting to attach a partition to the table.

109

Modify the query to place the text search function in a sub-select that directly references the partitioned table that contains the text index and that does not contain an OUTER JOIN clause.

110

Provide a string constant for the security policy name parameter.

111

Do not associate an audit policy with a typed table.

112

Do not try to configure actions or notifications for the health monitor on non-root installations.

113

If possible, define the trigger or function using a compound SQL (inlined) statement, or remove the trigger or function definition.

114

Create the spatial index as a nonpartitioned index by using the NOT PARTITIONED clause on the CREATE INDEX statement.

115

Record the privileges granted to the function in SYSCAT.ROUTINEAUTH, drop the function, recreate the function, and then grant the privileges to the function.

116

Give each named parameter marker in a compound SQL (compiled) statement that is dynamically prepared or executed a unique name.

119

Do not specify an index value when retrieving element values when the field of a ROW variable has an ARRAY type.

120

No response required. Inserting into this type of table is not currently supported.

121

Do not include the MAINTAINED BY USER clause on this table.

122

Include the MAINTAINED BY USER clause on this table.

sqlcode: -270

sqlstate: 42997

SQL0271N Index file for table with fid fid is either missing, or is not valid.

Explanation

The index file for the table with fid fid is required during processing. The file is either missing, or it is not valid.

The statement cannot be processed, and the application is still connected to the database. This condition does not affect other statements that do not use the index on this table.

User response

Ensure that all users are disconnected from the database, then issue the RESTART DATABASE command on all nodes. Then try the request again.

The index (or indexes) is re-created when the database is restarted.

sqlcode: -271

sqlstate: 58004

SQL0276N The connection failed because the database is in "restore pending" state or in "upgrade pending" state. Database name: database-name.

Explanation

This message can be returned for two reasons:

1. The database is in "restore pending" state

As a result of a previous operation, the database is in "restore pending" state. While the database is in "restore pending" state, attempts to connect to the database will fail.

2. The database is in "upgrade pending" state

If the db2ckupgrade utility finds that a database is ready to be upgraded, the db2ckupgrade utility will set the read-only database configuration parameter UPGRADE_PENDING to 1. While this database configuration parameter is set to 1, the database is said to be in "upgrade pending" state. While the database is in "upgrade pending" state, attempts to connect to the database will fail.

User response

  1. If the database configuration parameter UPGRADE_PENDING is set to 1, respond in one of the following ways:
    • Wait until the database is upgraded and then connect to the database.
    • Take the database out of "upgrade pending" state by issuing the db2ckupgrade command with the -resetUpgradePending parameter, and then connect to the database.
  2. Otherwise, restore the database, and then connect to the database.

sqlcode: -276

sqlstate: 08004

SQL0279N The database connection has been terminated during COMMIT or ROLLBACK processing. The transaction could be indoubt. Reason code = reason-code.

Explanation

Commit processing encountered an error. The transaction has been put in the commit state, but the commit processing might not have completed. The application's database connection has been terminated.

The cause of the error is indicated by the reason-code:

1

A node or data source involved in the transaction has failed.

2

Commit was rejected on one for the nodes. Check the administration notification log for details.

User response

Determine the cause of the error. It might be necessary to contact the system administrator for assistance because the most common cause of the error is node failure or connection failure. The RESTART DATABASE command will complete the commit processing for this transaction.

sqlcode: -279

sqlstate: 08007

SQL0280W View, trigger or materialized query table name has replaced an existing inoperative view, trigger or materialized query table.

Explanation

An existing inoperative view, trigger or materialized query table name was replaced by:
  • the new view definition as a result of a CREATE VIEW statement
  • the new trigger definition as a result of a CREATE TRIGGER statement
  • the new materialized query table definition as a result of a CREATE SUMMARY TABLE statement.

User response

None required.

sqlcode: +280

sqlstate: 01595

SQL0281N Table space tablespace-name cannot be altered with additional containers because it is a system managed table space.

Explanation

Additional containers cannot be added to a system managed table space. The exception to this is when a database partition group was modified to add a node without table spaces, then containers can be added once on the new node using the ALTER TABLESPACE command. In general, the table space must be managed by the database in order to add additional containers.

The statement cannot be processed.

User response

To add more containers to a system managed table space, drop and recreate the table space with more containers, ensuring that each container is of the same size and less than the container size limit, or change to a DMS table space.

sqlcode: -281

sqlstate: 42921

SQL0282N Table space tablespace-name cannot be dropped because at least one of the tables in it, table-name, has one or more of its parts in another table space.

Explanation

A table in the specified table space does not contain all of its parts in that table space. If more than one table spaces are specified, then a table in one of the specified table spaces does not contain all of its parts in the list. The base table, indexes, or long data may be in another table space, so dropping the table space(s) will not completely drop the table. This would leave the table in an inconsistent state and therefore the table space(s) cannot be dropped.

User response

Ensure that all objects contained in table space tablespace-name contain all their parts in this table space before attempting to drop it, or include those table spaces containing the parts in the list to be dropped.

This may require dropping the table table-name before dropping the table space.

sqlcode: -282

sqlstate: 55024

SQL0283N System temporary table space tablespace-name cannot be dropped because it is the only system temporary table space with a page-size page size in the database.

Explanation

A database must contain at least one system temporary table space with the same page size as the page size of the catalog tablespace. Dropping table space tablespace-name would remove the last system temporary tablespace with a page-size page size from the database.

User response

Ensure there will be another system temporary table space with a page-size page size in the database before attempting to drop this table space.

sqlcode: -283

sqlstate: 55026

SQL0284N Table creation failed because the table space tablespace-name that was specified in the statement after the clause clause is not a supported type of table space for that clause. Table space type: tablespace-type.

Explanation

This message is returned when an attempt is made to create a table with properties that are not supported with the type of table space in which the table is being created.

This message can be returned when the following types of SQL statements are executed:

  • CREATE TABLE
  • CREATE GLOBAL TEMPORARY TABLE
  • DECLARE GLOBAL TEMPORARY TABLE

Examples of the kinds of incompatibilities that can cause this message to be returned include the following situations:

  • An attempt was made to create a regular table in a table space that is not a REGULAR or LARGE table space.
  • An attempt was made to create or declare a temporary table in a table space that is not a USER TEMPORARY table space.
  • An attempt was made to create an insert time clustering (ITC) table in a table space that is not a managed by database table space.
  • An attempt was made to create a column-organized table in a table space that is not defined as MANAGED BY AUTOMATIC STORAGE and does not have an associated storage group.

User response

Correct the statement to specify a table space with the correct type for the clause clause.

sqlcode: -284

sqlstate: 42838

SQL0285N The indexes and/or long columns for table table-name cannot be assigned to separate table spaces because the primary table space tablespace-name is a system managed table space.

Explanation

If the primary table space is a system managed table space, all table parts must be contained in that table space. A table can have parts in separate table spaces only if the primary table space, index table space and long table space are database managed table spaces.

User response

Either specify a database managed table space for the primary table space, or do not assign the table parts to another table space.

sqlcode: -285

sqlstate: 42839

SQL0286N A table space could not be found with a page size of at least pagesize that authorization ID user-name is authorized to use.

Explanation

The CREATE TABLE, CREATE GLOBAL TEMPORARY TABLE, or DECLARE GLOBAL TEMPORARY TABLE statement did not specify a table space, and a table space of the right type (USER TEMPORARY for created temporary table or declared temporary table) with sufficient page size (at least pagesize), over which authorization ID user-name has USE privilege, could not be found.

Sufficient page size for a table is determined by either the byte count of the row or the number of columns.

User response

Ensure the existence of a table space of the correct type (REGULAR or USER TEMPORARY) with a page size of at least pagesize and that authorization ID user-name has USE privilege on this table space.

sqlcode: -286

sqlstate: 42727

SQL0287N SYSCATSPACE cannot be used for user objects.

Explanation

The CREATE TABLE or GRANT USE OF TABLESPACE statement specified a table space named SYSCATSPACE which is reserved for catalog tables.

User response

Specify a different table space name.

sqlcode: -287

sqlstate: 42838

SQL0288N The statement failed because a large table space cannot be defined when specifying the MANAGED BY SYSTEM clause.

Explanation

A LARGE table space is defined to store large objects and long strings. These objects can only be stored in table spaces that are defined as automatic storage.

This message is returned when an attempt was made to create a large table space as a system managed table space.

User response

To resolve the issue reported by this message, here are some examples of the actions that you can perform:

  • Issue the the CREATE TABLESPACE statement without the LARGE clause.
  • Issue the the CREATE TABLESPACE statement with the MANAGED BY AUTOMATIC STORAGE clause statement.

sqlcode: -288

sqlstate: 42613

SQL0289N Unable to allocate new pages in table space tablespace-name.

Explanation

One of the following conditions is true on one or more database partitions:

1

One of the containers assigned to this SMS table space has reached the maximum file size. This is the likely cause of the error.

2

All the containers assigned to this DMS table space are full. This is the likely cause of the error.

3

A rebalance is in progress, but has not progressed far enough to enable the newly added space to be used.

4

A redirected restore is being done to containers that are too small.

5

A rollforward is being done following a redirected restore and all the containers assigned to this tablespace are full.

6

A rollforward skipping add containers is being done and all the containers assigned to this tablespace are full.

7

An attempt was made to create a table space with less than 5 usable extents.

8

An auto-resize table space has reached its maximum size and all of the containers are full. Alternately, there is not enough space between the current size and the maximum size for containers to be extended or added so an automatic increase in space is not possible.

9

An automatic storage table space is being created with a value for initial size that does not result in an equal distribution of container space. As a result, a higher value is being used but this value is larger than the maximum size specified.

10

A DMS table space enabled for auto-resize has not reached its maximum size but one of the file systems on which the containers exists is full and the container cannot grow.

11

A DMS table space enabled for auto-resize has not reached its maximum size and the file systems on which the table space resides are not full. However, a container operation (or a subsequent rebalance) is in progress and the auto-resize capability is suspended until it is complete.

User response

Perform the action corresponding to the cause of the error:

1

Re-create as an AUTOMATIC STORAGE table space or an SMS table space with more directories (PATHs) such that: (number of directories) >= (max tablesize / maxfilesize) or re-create. Note that maximum file size is operating system dependent. Re-creating the table space as AUTOMATIC STORAGE allows you use storage groups.

2

Add new container(s) to the DMS table space and try the operation again, after the rebalancer has made the new pages available for use.

3

Wait for the rebalancer to finish.

4

Perform the redirected restore again to larger containers.

5

Perform the redirected restore again to larger containers.

6

Perform the rollforward again allowing add containers, or perform a redirected restore to larger containers.

7

Resubmit the CREATE TABLESPACE statement, ensuring that the table space has at least 5 usable extents.

8

Increase the maximum size for the table space.

9

Reduce the initial size or increase the maximum size for the table space.

10

Add a new stripe set of containers to the table space. Existing containers will no longer grow, only those new containers in the last range of the table space are extended when an automatic resize occurs.

11

Wait for the operation and subsequent rebalance to complete.

sqlcode: -289

sqlstate: 57011

SQL0290N Table space access is not allowed.

Explanation

A process attempted to access a table space which is in an invalid state, for which the intended access is not allowed.

  • If the table space is in a quiesced state ("Quiesced: SHARE", "Quiesced: UPDATE", or "Quiesced: EXCLUSIVE"), only processes which also hold the table space in a quiesced state are allowed access to the table space.
  • If the table space is in any other state, only the process which is performing the action that caused the current table space state is allowed access to the table space.
  • A system or user temporary table space cannot be dropped which contains active system temporary tables, create temporary tables, or declared temporary tables.
  • The SET CONTAINER API cannot be used to set the container list unless the table space is in the "Restore pending" state.

User response

Possible actions include:

  • If the table space is in a quiesced state, attempt to acquire a quiesced share or quiesced update state on the table space. Or, attempt to quiesce reset the table space.
  • If the table space is in any other state, wait until the table space has returned to normal state before attempting to access the table space.

Refer to the Administration Guide for further information about the table space states.

sqlcode: -290

sqlstate: 55039

SQL0291N State transition not allowed on table space.

Explanation

An attempt was made to change the state of a table space. Either the new state is not compatible with the current state of the table space, or an attempt was made to turn off a particular state and the table space was not in that state.

User response

Table space states change when a backup is taken, the load completes, the rollforward completes, etc., depending on the current state of the table spaces. Refer to the systems administration guide for further information about the table space states.

sqlcode: -291

sqlstate: 55039

SQL0292N An internal database file could not be created.

Explanation

An internal database file could not be created.

User response

Check that the directory containing the file is accessible (for example, mounted) and writeable by the database instance owner.

sqlcode: -292

sqlstate: 57047

SQL0293N Error accessing a table space container.

Explanation

This error may be caused by one of the following conditions:

  • A container (directory, file or raw device) was not found.
  • A container is not tagged as being owned by the proper table space.
  • A container tag is corrupt.

This error can be returned during database startup and during the processing of the ALTER TABLESPACE SQL statement.

User response

Try the following actions:

  1. Check that the directory, file, or device exists and that the file system is mounted (if it is on a separate file system). Containers must be readable and writable by the database instance owner.
  2. If you have a recent backup, try restoring the table space or database. If that fails because of the bad container and the container is not a DEVICE type, try manually removing the container first.

If the error was returned from the processing of an ALTER TABLESPACE SQL statement with the SWITCH ONLINE option, then re-issue the statement after correcting the problem.

If the error persists, call your IBM service representative.

sqlcode: -293

sqlstate: 57048

SQL0294N The container is already in use.

Explanation

Table space containers cannot be shared. The possible causes of this error include the following.

  • A CREATE TABLESPACE or ALTER TABLESPACE statement included a container that is already in use by another table space.
  • A CREATE TABLESPACE or ALTER TABLESPACE statement included a container from a table space that has been dropped but the drop statement has not been committed.
  • An ALTER DATABASE PARTITION statement used to add a database partition used the containers of a LIKE database partition that is on the same physical database partition. These containers would therefore already be in use.
  • A CREATE TABLESPACE or ALTER TABLESPACE statement is attempting to use the same container on more than one logical database partition on a single physical database partition. The same containers cannot be used for more than one database partition on the same physical database partition.
  • An ADD DATABASE PARTITION command or API used the containers from the system temporary table spaces of a LIKE database partition that is on the same physical database partition. These containers would therefore already be in use.
  • A CREATE TABLESPACE statement, ALTER TABLESPACE statement, or CREATE DATABASE command included a DMS container from another database that no longer exists but was not dropped properly. The container is not actually in use but it is tagged as being in use. Therefore, the DB2 data server will not allow it to be used until it is untagged. However, it is very important to verify that the container is not in use by the same database or another database when untagging it. If the container is in use when you untag it, the database (or databases) involved will be corrupted.
  • A REORG attempted to automatically select a DMS temporary table space for use, and although one with the correct page size exists, it is currently in use by another REORG command.
  • The ADD DBPARTITIONNUM option of the REDISTRIBUTE command, which was used to add a database partition, creates table space container names on the newly added database partition based on the table space container names of the table spaces on the lowest numbered database partition. If these container names specify absolute paths, and if the new database partition is on the same physical device as a database partition using the same container names, then the containers for the new partition would already be in use.
  • A RESTORE DATABASE command has found containers from a database that no longer exists but was not dropped properly.
  • A temporary staging database was created for a transport operation, and then an attempt was made to create a table space on the target database while the temporary staging database still exists.

User response

Ensure the containers are unique.

  • For the CREATE or ALTER TABLESPACE statement, specify a different container for the table space.
  • For the CREATE or ALTER TABLESPACE statement including a container from a dropped table space, try again after the drop statement is committed or specify a different container.
  • For the ALTER DATABASE PARTITION statement, reissue the statement using the WITHOUT TABLESPACES clause, and then use the ALTER TABLESPACE statement to create unique containers for the new database partition.
  • For CREATE or ALTER TABLESPACE statements where the environment includes more than one logical database partition on a physical database partition, ensure that the same containers are not specified for such logical database partition.
  • For an ADD DATABASE PARTITION command or API, reissue the statement using the WITHOUT TABLESPACES clause, and then use the ALTER TABLESPACE statement to create unique containers at the new database partition for the system temporary table spaces.
  • If you are trying to use a DMS container that belonged to a database that no longer exists but was not dropped properly, then the db2untag utility can be used to remove the DB2 container tag from it. When this tag is removed DB2 considers the container to be free and the container can be used in a CREATE TABLESPACE statement, ALTER TABLESPACE statement, or CREATE DATABASE command.

    NOTE: Use extreme caution with db2untag. If you issue a db2untag command against a container that is still in use by a database, then both the database that originally used the container and the database that is now using the container will be corrupted.

  • For REORG, resubmit the command once the initial REORG that is using the required table space completes, or provide another temporary table space of the correct page size for use.
  • For the REDISTRIBUTE command, instead of using the ADD DBPARTITIONNUM option, before issuing the REDISTRIBUTE command issue the ALTER DATABASE PARTITION GROUP statement using the WITHOUT TABLESPACES clause, and then use the ALTER TABLESPACE statement to create unique containers for the new database partition.
  • For the RESTORE DATABASE command (where a container belongs to a database that no longer exists but was not dropped properly), remove the container.

    NOTE: Ensure that the container is not in use by another database prior to removing it.

  • If a temporary staging database was created for a transport operation, remove the temporary staging database after the staging database is no longer needed, and then attempt operations on the target that were blocked as a result of the existence of the staging database.

sqlcode: -294

sqlstate: 42730

SQL0295N The combined length for all container names for the table space is too long.

Explanation

The total space required to store the list of containers exceeds the space allotted for this table space in the table space file.

User response

Try one or more of the following:
  • Use symbolic links, mounted file systems, etc. to shorten the new container names.
  • Back up the table space and then use the database administration utility to reduce the number and/or name lengths of the containers. Restore the table space to the new containers.

sqlcode: -295

sqlstate: 54034

SQL0296N The CREATE statement failed because a database limit for the object has been reached. Limit: limit-number. Object type keyword: object-keyword

Explanation

This message is returned when an attempt is made to create a database object when there are already the maximum number of that type of database object defined for the database.

User response

Respond to this error in one of the following ways:

  • Delete any database objects of the same type that are not being used any more, and then reissue the CREATE statement.
  • For table spaces:
    1. Move data from multiple, small table spaces into one, larger table space.
    2. Delete the original, small table spaces.
    3. Reissue the CREATE statement.
  • For Hadoop tables:
    • If the limit exceeded is the number of data types defined in the database, drop a type previously created by CREATE TYPE ARRAY or CREATE TYPE ROW or drop the Hadoop table which has column of type ARRAY or ROW.

sqlcode: -296

sqlstate: 54035

SQL0297N Path name for container or storage path is too long.

Explanation

One of the following conditions is true:
  • The full path specifying the container name exceeds the maximum length allowed (254 characters). If the container was specified as a path relative to the database directory, the concatenation of these two values must not exceed the maximum length. Details can be found in the administration notification log.
  • The storage path exceeds the maximum length allowed (175 characters).

User response

Shorten the path length.

sqlcode: -297

sqlstate: 54036

SQL0298N Bad container path.

Explanation

The container path violates one of the following requirements:

  • Container paths must be valid fully-qualified absolute paths or valid relative paths. The latter are interpreted relative to the database directory.
  • For EXTEND, REDUCE, RESIZE and DROP operations, the specified container path must exist.
  • The path must be read/write accessible to the instance id (check file permissions on UNIX-based systems).
  • Containers must be of the type specified in the command (directory, file or device).
  • Containers (directories) in system managed table spaces must be empty when designated as containers and must not be nested underneath other containers.
  • The containers for one database must not be located underneath the directory of another database, and they may not be underneath any directory that appears to be for another database. This rules out any directory of the form SQLnnnnn, where 'n' is any digit.
  • The container must be within the file size limit for the operating system.
  • Containers (files) for dropped database managed table spaces can only be reused as containers (directories) for system managed table spaces after all agents terminate and vice versa.
  • During a redirected restore, an SMS container was specified for a DMS table space or a DMS container was specified for an SMS table space.
  • The specified type of the container for an EXTEND, REDUCE, RESIZE, or DROP operation does not match the type of the container (FILE or DEVICE) that was specified when the container was created.

This message will also be returned if any other unexpected error occurred which prevents DB2 from accessing the container.

If you are using a cluster manager, this error can be returned if the database manager failed to add the database container path to the cluster manager configuration. If the cluster manager cannot access this path, the cluster manager will not be able to successfully manage a failover involving this path. Error messages from the cluster manager will be recorded in the db2diag log file.

User response

Specify another container location or change the container to make it acceptable to DB2 (such as changing file permissions) and try again.

If you are using a cluster manager, correct the problem and resubmit the command:

  1. Review the db2diag log file for error messages from the cluster manager.
  2. Respond to the cluster manager error messages in the db2diag log file to correct the underlying problem that prevented the database manager from adding the path to the cluster manager configuration.
  3. Resubmit the command.

sqlcode: -298

sqlstate: 428B2

SQL0299N Container is already assigned to the table space.

Explanation

The container that you are attempting to add has already been assigned to the table space.

User response

Choose another container and try again.

sqlcode: -299

sqlstate: 42731

SQL0301N The value of input variable, expression or parameter number number cannot be used because of its data type.

Explanation

A variable, expression, or parameter in position number 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. In the case of a user-defined structured type, the associated built-in type of the host variable or SQLTYPE might not be compatible with the parameter of the TO SQL transform function defined in the transform group for the statement. In the case of performing an implicit or explicit cast between character and graphic data types, this error indicates that such a cast was attempted with a non-Unicode character or graphic string.

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 out of range for its corresponding use.

Explanation

The value of an input host variable was found to be out of range for its use in the SELECT, VALUES, or prepared statement.

One of the following occurred:

  • The corresponding host variable or parameter marker used in the SQL statement is defined as string, but the input host variable contains a string that is too long.
  • The corresponding host variable or parameter marker used in the SQL statement is defined as numeric, but the input host variable contains a numeric value that is out of range.
  • The terminating NUL character is missing from the C language NUL-terminated character string host variable.
  • Federated system users: in a pass-through session, a data source-specific restriction might have been violated.

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.

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, FETCH or assignment statement because the data types are not compatible.

Explanation

An embedded SELECT, VALUES, FETCH or assignment statement assigns to a host variable, but the data type of the variable is not compatible with the data type of the corresponding SELECT-list, VALUES-list, or right-hand side of the assignment statement element. For a user-defined data type, the host variable might be defined with an associated built-in data type that is not compatible with the result type of the FROM SQL transform function defined in the transform group for the statement. 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. For a user-defined data type, verify that the associated built-in type of the host variable is compatible with the result type of the FROM SQL transform function defined in the transform group for the statement.

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, SELECT, or assignment 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 because no indicator variable is specified.

Explanation

A FETCH, assignment, 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, the elements of the VALUES list, or the right-hand side of the assignment statement. 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 statement was not processed because the following host variable is either undefined or used in a way that is unsupported: variable_name.

Explanation

This message can be returned when a host variable is used in the following invalid ways:

  • A host variable, variable_name, is used in a dynamic SQL statement or in a DDL statement.
  • A host variable, variable_name, that is a structure is used in a place where structure references are not permitted.

User response

Take one of the following steps and then execute the statement again:

  • In dynamic SQL statements, use parameter markers instead of host variables.
  • In DDL statements, remove references to host variables.
  • Replace the structure reference with a host variable that is not a structure.
  • Remove the host variables from expression keys in any expression-based index definitions.
  • If you declared multiple structure arrays, remove all but one of the declarations.

sqlcode: -312

sqlstate: 42618

SQL0313N The number of variables in the EXECUTE statement, the number of variables in the OPEN statement, or the number of arguments in an OPEN statement for a parameterized cursor is not equal to the number of values required.

Explanation

The number of variables specified in the EXECUTE or OPEN statement does not equal the number of variables required for the parameter markers appearing in the SQL statement.

If a parameterized cursor is referenced, the number of cursor arguments is not the same as the number expected.

User response

Correct the application program so the number of variables specified in the EXECUTE or OPEN statement is correct for the parameter markers in the SQL statement.

Correct the parameterized cursor reference so that the correct number of arguments is specified.

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 type specified is not one that is supported.
  • The length specification is 0, negative, or too large.
  • An initializer is used.
  • An incorrect syntax is specified.
  • A host variable array with cardinality larger than the maximum allowed value is specified.

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 type specified is not one that is supported.
  • The length specification is 0, negative or too large.
  • An incorrect syntax is specified.

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.

SQL0327N The row cannot be inserted into table table-name because it is outside the bounds of the defined data partition ranges.

Explanation

If the operation is an insert or an update, the value of the table partitioning key for the row is not within range of values for any defined data partition.

If the operation is altering a table to become a partitioned table, then there exists one or more rows in the table with a table partitioning key value that is not within the range of values for any defined data partition.

The statement cannot be processed.

User response

For an insert or update operation, ensure that the table partitioning key columns are within the specified ranges for the data partitions of the table.

An additional data partition may need to be added to the table.

If altering a table to become a partitioned table, ensure that the necessary ranges are specified to allow all of the data in the table to be within a range of a data partition.

sqlcode: -327

sqlstate: 22525

SQL0329N The path name list string-constant-or-host-variable is not valid.

Explanation

String constant or input host variable string-constant-or-host-variable contains a path name list that is not valid. The maximum number of schema names for the SQL path (FUNCPATH bind option or CURRENT PATH special register) or package path (CURRENT PACKAGE PATH special register) has been exceeded. See the Limits appendix of the SQL Reference for details of this limit.

The statement or command cannot be processed.

User response

Specify fewer schema names so as to not exceed the limit. Consider consolidating user-defined functions, procedures, methods, distinct types, or packages to fewer schemas.

sqlcode: -329

sqlstate: 0E000

SQL0330N A string cannot be used because it cannot be processed. Reason code=reason-code. Code point=code-point. Host variable position=host-variable-position.

Explanation

A string cannot be processed because a translation error occurred during the translation of a string to a different coded character set. The type of error is indicated by the reason-code:
8
Length exception (for example, expansion required for PC MIXED data exceeds the maximum length of the string).
12
Invalid code point (for example, use of the ERRORBYTE option of SYSSTRINGS).
16
Form exception (for example, invalid MIXED data).
20
Conversion procedure error (for example, an exit on a z/OS server set the length control field of the string to an invalid value).
24
Single byte character found in string contained in a wchar_t host variable.

If the reason-code is 12, code-point is the invalid code point. Otherwise, code-point is either blank or an additional reason code returned by an exit. If the string is the value of an input host variable, the position-number is the ordinality of the variable in the SQLDA. If the string is not the value of a host variable, the position-number is blank.

The statement cannot be processed.

User response

Take one of the following actions based on the reason-code:
8
Extend the maximum length of the host variable to allow for the expansion that occurs when the string is converted.
12
Either change the convert table to accept the code-point or the data to eliminate the code-point.
16
If the string is described as MIXED data, either change its description or the string to conform to the rules for well-formed mixed data.
20
Correct the conversion procedure.
24
Delete the single byte character from the graphic string.

sqlcode: -330

sqlstate: 22021

SQL0332N Character conversion from the source code page source-code-page to the target code page target-code-page is not supported.

Explanation

The operation failed because there is no code page conversion between the source-code-page and target-code-page. This may be due to one of the following reasons:

  1. The character repertoires of the source code page and the target code page are incompatible, and therefore may cause character loss and corruption when converting between the source and target code pages.
  2. This specific code page conversion is not supported.

Some of the possible operations that can cause this error include:

  • Connecting a client to a database where the client's code page is different from the database code page.
  • Executing an SQL statement where the client's code page is different from the database code page.
  • Importing or exporting an IXF file where the file's code page is different from the database code page.
  • Federated system users: the data source does not support the specified code page conversion.

User response

  1. Make the source and target code pages compatible with each other. To set the client's code page compatible with the database code page:
    • On Unix platforms, set the LANG, LC_CTYPE or LC_ALL environment variable to a locale whose code page is compatible with the database code page. Consult the platform documentation to see the valid locale names and the code page associated with each of them.
    • On Windows platforms, set the DB2CODEPAGE registry variable to override the client's code page with a value compatible with the database code page.
  2. If the source and target code pages are compatible, then DB2 currently does not support this particular code page conversion. Contact your technical service representative to determine if such support can be added.

DB2 UDB for iSeries users should be aware that character or graphic columns with CCSID 65535 are not supported. Character or graphic columns with CCSID 65535 must be converted to a supported CCSID (using CAST) before they can be accessed using DB2 Connect.

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:

  • decreasing the length of the source string or increasing the size of the target object (refer to the note that follows this list),
  • altering the operation,
  • casting the encrypted data value to a VARCHAR string with a larger number of bytes before using it in a decryption function, or
  • ensuring that the application codepage and the database codepage are the same. This eliminates the need for codepage conversions for most connections.

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

SQL0336N The scale of the decimal number must be zero.

Explanation

The decimal number is used in a context where the scale must be zero. This can occur when a decimal number is specified in a CREATE or ALTER SEQUENCE statement for START WITH, INCREMENT, MINVALUE, MAXVALUE or RESTART WITH.

The statement cannot be processed.

User response

Change the decimal number to remove any non-zero digits from the right side of the decimal delimiter.

sqlcode: -336

sqlstate: 428FA

SQL0338N An ON clause associated with a JOIN operator or in a MERGE statement is not valid.

Explanation

An ON clause associated with a JOIN operator or in a MERGE statement is not valid for one of the following reasons.
  • Column references in an ON clause must only reference columns of tables that are in the scope of the ON clause.
  • A function referenced in an ON clause of a full outer join must be deterministic and have no external action.
  • A dereference operation (->) cannot be used.
  • The ON clause of a MERGE statement cannot include a subquery.
  • The ON clause of a MERGE statement cannot include a scalar fullselect.
  • The ON clause of a MERGE statement cannot include an inlined SQL function or an inlined SQL method.

The statement cannot be processed.

User response

Correct the ON clause to reference appropriate columns or remove any dereference operators.

If using full outer join ensure that all functions in the ON clause are deterministic and have no external action.

For the ON clause of a MERGE statement, remove any subqueries, scalar fullselects, inlined SQL functions, or inlined SQL methods.

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:
  • A fullselect within the common table expression name cannot start with SELECT DISTINCT because the common table expression is recursive.
  • A fullselect within the common table expression name specified UNION instead of UNION ALL as required for recursive common table expressions.

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, ORDER BY clause, or an explicit join including an ON clause.

Explanation

The common table expression name includes a reference to itself and therefore:
  • must be the union of two or more fullselects
  • cannot include a GROUP BY clause
  • cannot have column functions
  • cannot include a HAVING clause
  • cannot include an ORDER BY clause on the iterative fullselect
  • and cannot include an explicit join with an ON clause.

The statement cannot be processed.

User response

Change the common table expression by:
  • making it a union of two or more fullselects
  • removing any column functions, GROUP BY clause, HAVING clause, ORDER BY clause, or explicit JOIN including an ON clause.
  • removing the recursive reference.

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.
  • A recursive reference in the first fullselect before the UNION ALL set operator. The first fullselect must be an initialization and cannot include a recursive reference.
  • More than one reference to the same common table expression in the same FROM clause. Such references are not permitted in recursive common table expression.
  • A recursive reference in the FROM clause of a subquery. A recursion cycle cannot be defined using a subquery.

The statement cannot be processed.

User response

Change one of the following:
  • the fullselect prior to the union operator so that it does not include a recursive reference
  • the FROM clause containing more than one reference to the same common table expression to just one reference
  • the FROM clause of the subquery so that it does not reference the common table expression.

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:
  • incrementing an INTEGER column in the iterative select list by 1.
  • a predicate in the where clause of the iterative portion of the form "counter_col < constant" or "counter_col < :hostvar".

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

SQL0348N sequence-expression cannot be specified in this context.

Explanation

The statement contains a NEXT VALUE expression or PREVIOUS VALUE expression in an invalid context. NEXT VALUE expressions and PREVIOUS VALUE expressions cannot be specified in the following contexts:
  • join condition of a full outer join
  • DEFAULT value for a column in a CREATE TABLE or ALTER TABLE statement
  • generated column definition in a CREATE TABLE or ALTER TABLE statement
  • condition of a CHECK constraint
  • CREATE TRIGGER statement (a NEXT VALUE expression may be specified, but a PREVIOUS VALUE expression cannot be specified)
  • CREATE VIEW statement, CREATE METHOD statement or CREATE FUNCTION statement
NEXT VALUE expressions cannot be specified in the following contexts:
  • CASE expression
  • argument list of an aggregate function
  • subquery except in the fullselect of an INSERT, UPDATE or VALUES INTO statement
  • SELECT statement for which the outer SELECT contains a DISTINCT operator
  • SELECT statement for which the outer SELECT contains a GROUP BY clause
  • join condition of a join
  • SELECT statement for which the outer SELECT is combined with another SELECT statement using the UNION, INTERSECT or EXCEPT set operator
  • nested table expression
  • argument list of a table function
  • argument list of an XMLTABLE, XMLQUERY or XMLEXISTS expression
  • WHERE clause of the outer-most SELECT statement, DELETE or UPDATE statement
  • ORDER BY clause of the outer-most SELECT statement
  • select-cause of the fullselect of an expression, in the SET clause of an UPDATE statement
  • IF, WHILE, DO...UNTIL, or CASE statement in an SQL routine
  • argument list of the CONNECT_BY_ROOT operator and the SYS_CONNECT_BY_PATH function
  • START WITH and CONNECT BY clauses

The statement cannot be executed.

User response

Remove the reference to the sequence expression and resubmit the statement.

sqlcode: -348

sqlstate: 428F9

SQL0349N The specification of the NEXT VALUE expression for the column in position column-position must match the specification of all other expressions for the same column for all rows.

Explanation

The expression specified for the column in position column-position of a VALUES clause of a multiple row INSERT statement or VALUES expression included a NEXT VALUE expression. When an expression containing a NEXT VALUE expression is used to specify the value of a column in one of these contexts, then that same expression must be specified for that column for all rows. For example, the following INSERT statement succeeds:
INSERT INTO T1 
  VALUES(
    NEXT VALUE FOR sequence1 + 5, 'a'
    ),
    (
    NEXT VALUE FOR sequence1 + 5, 'b'
    ),
    (
    NEXT VALUE FOR sequence1 + 5, 'c'
    )
However, the following INSERT statement fails:
INSERT INTO T1 
  VALUES(
    NEXT VALUE FOR sequence1 + 5, 'a'
    ),
    (
    NEXT VALUE FOR sequence1 + 5, 'b'
    ),
    (
    NEXT VALUE FOR sequence1 + 4, 'c'
    )

User response

Correct the syntax and resubmit the statement.

sqlcode: -349

sqlstate: 560B7

SQL0350N The column column-name was implicitly or explicitly referenced in a context where the data type of the column is not supported.

Explanation

The ALTER statement, CREATE statement, or DECLARE GLOBAL TEMPORARY TABLE statement is invalid for one of the following reasons:

  • A LOB, LONG VARCHAR, LONG VARGRAPHIC, XML, or structured type column cannot be used in a key.
  • A LOB, LONG VARCHAR, LONG VARGRAPHIC, XML, or structured type column cannot be used in a unique constraint.
  • A LOB, LONG VARCHAR, LONG VARGRAPHIC, XML, or structured type column cannot be used in a generated column.
  • A LONG VARCHAR, LONG VARGRAPHIC, SYSPROC.DB2SECURITYLABEL, XML, or structured type column cannot be used in a created temporary table.
  • A LONG VARCHAR, LONG VARGRAPHIC, SYSPROC.DB2SECURITYLABEL, distinct type, or structured type column cannot be used in a declared temporary table.
  • A LOB column cannot be used in an index definition.
  • An XML column can only be used in an index definition if it is the only column and an XMLPATTERN clause is specified.
  • A structured type column can only be used in an index definition if it is the only column and has an associated index extension specified.
  • The definition of a column mask or a row permission cannot reference a LOB or XML column.
  • A column mask cannot be defined for a LOB or XML column.
  • In Hadoop tables:
    • Columns whose type is array cannot be used in a unique definition.
    • Columns whose type is row cannot be used in a unique definition.
    • Columns whose type is array cannot be used in primary key definitions.
    • Columns whose type is row cannot be used in primary key definitions.
    • Columns whose type is array cannot be used in index definitions.
    • Columns whose type is row cannot be used in index definitions.
    • The first column cannot have a data type of array or row.

The same restrictions apply to a distinct type column where the base data type is subject to one of the restrictions in the listed previously.

The statement cannot be processed.

User response

Remove the column from the context where the data type is not supported or change the data type of the column. If indexing an XML column or structured type column, ensure that it is the only column and that the index definition includes the appropriate clauses.

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

SQL0356N The index was not created because a key expression was invalid. Key expression: expression-number. Reason code: reason-code.

Explanation

You can create a table index which includes expression-based keys. This message is returned when an attempt is made to create an index that includes expression-based keys, and one of the following conditions exists:

  • There is something invalid about one of the expression-based key definitions
  • The table does not support expression-based keys

The runtime token expression-number identifies which key expression in the statement is invalid. For example, if there are two key expressions in the CREATE INDEX statement, and the second key expression is invalid, the value of expression-number will be: "2". If the expression number cannot be determined, a default value of "*" will be returned.

The reason code indicates what was invalid about the key expression:

1

The key expression contained a subquery.

2

The key expression did not contain a reference to at least one column.

3

The key expression referenced a special register or the key expression referenced a function that depends on the value of special register.

5

The key expression included a user-defined function.

6

The same key expression appears more than once in the index definition.

15

The key expression referenced a global variable or the key expression referenced a function that depends on the value of a global variable.

16

The key expression referenced a sequence.

17

The key expression referenced an unsupported type of function:

  • A non-deterministic function
  • A function with external actions
  • A function that has an unsupported access level:
    • READ SQL DATA
    • MODIFIES SQL DATA
18

The key expression included a value with an unsupported data type.

19

The key expression included an aggregate function or an OLAP specification.

20

The SCOPE clause was included in the index definition and the key expression contained one of the following:

  • Dereference operation
  • A TYPE predicate
  • A CAST specification
21

The key expression includes an XMLQUERY expression or an XMLEXISTS expression.

22

An attempt was made to create an expression-based index on a table that does not support expression-based indexes.

23

The key expression referenced an unsupported type of function such as the LIKE predicate.

24

The result data type of the expression-based key is not indexable.

User response

Correct the error in the key expression, and reissue the statement.

sqlcode: -356

sqlstate: 429BX

SQL0359N The range of values for the identity column or sequence is exhausted.

Explanation

The database manager attempted to generate a value for an identity column or sequence object, however all allowable values have already been assigned.

The statement cannot be processed.

User response

For an identity column, redefine the table with a larger range of values for the identity column. If a MAXVALUE or MINVALUE specification has been made that limits the range of values to be less than the range for the data type of the column, then the column can be altered to expand the range of valid values. Otherwise, the identity column must be recreated which requires that the table be recreated. First drop the existing table, and then recreate the table with a different data type for the identity column, specifying a data type that has a larger range of values than the current data type for the identity column.

For a sequence object, redefine the sequence with a larger range of values. If a MAXVALUE or MINVALUE clause limits the range of values to less than the range for the data type of the sequence object, then alter the sequence to expand the range of valid values. Otherwise, drop the sequence object and reissue the CREATE SEQUENCE statement specifying a data type that allows a larger range of values.

sqlcode: -359

sqlstate: 23522

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

SQL0361W The operation was successful, but some portion of the operation was unsuccessful. Tokens msg-token1 and msg-token2 provide further details about the operation msg-token3.

Explanation

The operation was successful as some of what was specified completed successfully, but some parts of the operation were unsuccessful.

User response

Determine what action to take, if any, depending on the operation msg-token3: SYSPROC.ADMIN_REVALIDATE_DB_OBJECTS - Some of the objects specified to be revalidated were not able to be revalidated successfully because at least one object that they reference does not exist or continues to be invalid. One object not revalidated is msg-token1 because of its reference to object msg-token2. If the objects not yet revalidated still need to be revalidated, then create any objects that should exist and correct any objects that continue to be invalid that are referenced by the objects to be revalidated. The SYSCAT.INVALIDOBJECTS catalog view contains information on invalid objects. If msg-token1 refers to an object of permission or mask, and msg-token2 contains CREATE PERMISSION or CREATE MASK, then ensure the user that runs ADMIN_REVALIDATE_DB_OBJECTS has SECADM authority.

sqlcode: +361

sqlstate: 0168B

SQL0364W DECFLOAT exception exception-type has occurred during operation operation.

Explanation

The exception exception-type occurred while doing an operation-type operation on a field whose data type is DECFLOAT. The exception occurred while processing an arithmetic expression.

The possible values for exception-type are:
  • UNDERFLOW for an underflow exception
  • OVERFLOW for an overflow exception
  • INEXACT for an inexact exception
  • INVALID OPERATION for an invalid operation exception
  • DIVISION BY ZERO for an division by zero exception
The possible values for operation-type are:
  • ADDITION for an addition operation
  • SUBTRACTION for a subtraction operation
  • MULTIPLICATION for a multiplication operation
  • DIVISION for a division operation
  • NEGATION for a negation operation
  • BUILT-IN FUNCTION for a built-in function operation

The DECFLOAT exception may occur due to a temporary internal copy of the data that was converted to DECFLOAT for the operation.

Any of the exceptions can occur during the processing of a built-in function. If the operation-type is FUNCTION, then the exception occurred while processing either an input, intermediate, or final value. The cause could be that the value of a parameter is out of range.

Statement processing continues.

User response

To stop this warning from being returned, examine the expression for which the warning occurred to see if the cause, or the likely cause, of the exception can be determined. The exception may be data-dependent, in which case it will be necessary to examine the data that was being processed at the time the warning occurred. See the SQL Reference for the supported ranges of DECFLOAT values.

sqlcode: +364

sqlstate: 0168C

sqlstate: 0168D

sqlstate: 0168E

sqlstate: 0168F

SQL0365N The statement was not processed because the value of the extended indicator variable in position position is not valid.

Explanation

You can represent the SQL null value in an application program by using an indicator variable with a host variable. You can also represent the default value or the unassigned value by using an extended indicator with host variables.

There are some restrictions on how and where extended indicators can be used. For example, values of default (-5) or unassigned (-7) must not be used for extended indicator variables in a VALUES clause that specifies more than one row of values.

This message is returned when a value of default (-5) or unassigned (-7) is used in a context in which these values are not allowed.

Diagnostic information in the runtime token position:

  • In general, the position given by the runtime token postition is the ordinal of the host variable that is using the extended indicator.
  • If position is 0, a mismatch in extended indicator support occurred. Extended indicator support was not explicitly enabled or disabled for the dynamically prepared UPDATE statement, and there was a mismatch between the extended indicator support that was explicitly enabled or disabled for the dynamically prepared SELECT statement that is the target of the update and the extended indicator support for the bind or precompile.

User response

Change the value of the extended indicator variable to an allowable value for the context in which it is used.

If position is 0, respond in one of the following ways:

  • Explicitly enable or disable extended indicator support for the dynamically prepared UPDATE statement.
  • Ensure that the extended indicator support specified for the dynamically prepared SELECT statement that is the target of the update is the same as the extended indicator support for the bind or precompile.

sqlcode: -365

sqlstate: 22539

SQL0368N The DB2 Data Links Manager dlm-name is not registered to the database.

Explanation

The DB2 Data Links Manager dlm-name is not registered to the database. Registered DB2 Data Links Managers are ignored if the database manager configuration parameter DATALINKS is set to NO. The DB2 Data Links Manager may have been dropped using the DROP DATALINKS MANAGER command. It is possible that a new incarnation of the DB2 Data Links Manager with the same name is currently registered; in that case, the error pertains to one or more previously dropped incarnations of that DB2 Data Links Manager.

The statement cannot be processed.

User response

Ensure that the database manager configuration parameter DATALINKS is set to YES. DATALINK values that are links to previously dropped DB2 Data Links Managers should be removed using the reconcile utility. For additional details, see the usage notes for the DROP DATALINKS MANAGER command in the Command Reference.

sqlcode: -368

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

SQL0372N Column types of ROWID, IDENTITY, security label, row change timestamp, row-begin, row-end, or transaction start-ID can only be specified once for a table.

Explanation

An attempt was made to do one of the following:

  • Create a table with more than one IDENTITY column.
  • Add an IDENTITY column to a table which already has one.
  • Create a table with more than one ROWID column.
  • Add a ROWID column to a table which already has one.
  • Create a table with more than one security label column.
  • Add a security label column to a table that already has one.
  • Create a table with more than one row change timestamp column.
  • Add a row change timestamp column to a table that already has one.
  • Create a table with more than one row-begin column.
  • Add a row-begin column to a table that already has one.
  • Create a table with more than one row-end column.
  • Add a row-end column to a table that already has one.
  • Create a table with more than one transaction start-ID column.
  • Add a transaction start-ID column to a table that already has one.
  • Define a period more than once in a table.

The ROWID data type is supported in DB2 for z/OS and DB2 for iSeries.

The statement cannot be processed.

User response

For a CREATE TABLE statement, specify the specified attribute only once for the table. For an ALTER TABLE statement, the specified column already exists for the table. Do not attempt to define a period more than once in a table.

sqlcode: -372

sqlstate: 428C1

SQL0373N A DEFAULT clause cannot be specified for column or SQL variable name

Explanation

A DEFAULT clause was specified when defining or changing column or SQL variable name. The data type for the column definition or SQL variable declaration does not support DEFAULT. A CREATE or ALTER TABLE statement cannot use the DEFAULT clause when defining the following:

  • an identity column
  • a ROWID column
  • an XML column
  • a row change timestamp column
  • a security label column
  • a row-begin column
  • a row-end column
  • a transaction-start-ID column
  • a random distribution key column of a random distribution table using random by generation method

The statement cannot be processed.

User response

Remove the DEFAULT clause and resubmit the statement.

sqlcode: -373

sqlstate: 42623

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.

MODIFIES SQL DATA must be specified if the body of the function defined with LANGUAGE SQL can modify SQL data or if it calls a function or a procedure that can modify SQL data.

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.

The statement cannot be processed.

User response

Either specify the clause or change the function body.

sqlcode: -374

sqlstate: 428C2

SQL0385W Assignment to an SQLSTATE or SQLCODE variable in an SQL routine may be over-written and does not activate any handler.

Explanation

The SQL routine includes at least one statement that assigns a value to the SQLSTATE or SQLCODE special variables. These variables are assigned values by processing of SQL statements in the SQL routine. The value assigned may therefore be over-written as a result of the SQL statement processing. Furthermore, the assignment of a value to the SQLSTATE special variable does not activate any handlers.

The routine definition was processed successfully.

User response

None required. Remove any assignments to the SQLSTATE or SQLCODE special variable to prevent the warning.

sqlcode: +385

sqlstate: 01643

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
  • have exactly one parameter,
  • the data type of the parameter must be the same as the source data type,
  • the result data type must be the same as the target data type.

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 statement was not processed because the function function-name resolved to specific function specific-name that is not valid in the context where it is used.

Explanation

If the runtime token specific-name is an empty string, then the function resolved to the built-in function identified by the runtime token function-name.

This message can be returned in many scenario. Here is a short list of some of the possible situations in which this message can be returned:

  • The specific function is a scalar, column, or row function where only a table function is expected (such as in the FROM clause of a query).
  • The specified function has OUT or INOUT parameters and the context in which the function is used is not supported. A compiled function can be invoked only if the function invocation is the sole expression on the right hand side of a SET variable statement that is in a compound SQL (compiled) statement.
  • The specified function is not a generic table function, but a typed-correlation clause was specified.

User response

Respond to this error by performing one or more of the following troubleshooting steps:

  • Confirm that the function name and arguments are correct.
  • Confirm that the current path includes the schema where the correct function is defined.
  • 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 function is used in a GROUP BY or a HAVING clause but is not also included in the select list.
  • The function cannot be used in this context because of the recursive nature of the statement.
  • The function cannot be used in a check constraint.
  • The function cannot be used in a generated column.
  • The function cannot be used in a view definition where the WITH CHECK OPTION clause is specified or any view dependent on such a view having the WITH CHECK OPTION clause specified.
  • The function has an argument that does not resolve to a row of a base table. This would include the situation involving a result column of an outer join where NULL producing rows are possible.
  • The function cannot be used on rows from a replicated materialized query table.

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

SQL0396N Object-type object-name (specific name specific-name) attempted to execute an SQL statement during final call processing.

Explanation

A routine object-name (specific name specific-name) attempted to execute an SQL statement (other than CLOSE cursor) during FINAL CALL (call-type = 255) processing. This is not allowed.

User response

Change the routine to not issue SQL statements during FINAL CALL (call-type = 255) processing.

sqlcode: -396

sqlstate: 38505

SQL0401N The data types of the operands for the operation operator are not compatible or comparable.

Explanation

The operation using operator cannot be processed for one of the following reasons:

  • The data types of the operands must be comparable and compatible but there is at least one pair of types that is not comparable or compatible.
  • The data type of an operand is XML which cannot be compared (with itself or any other type).
  • The data type of an operand is DATALINK which cannot be compared (with itself or any other type).
  • The data type of an operand is a structured type which cannot be compared (with itself or any other type).
  • Columns of type array from two Hadoop tables cannot be compared directly.
  • Columns of type row from two Hadoop tables cannot be compared directly.

Federated system users: this data type violation can be at the data source or at the federated server.

Some data sources do not provide the appropriate values for operator. In these cases the message token will have the following format: "<data-source>:UNKNOWN", indicating that the actual value for the specified data source is unknown.

The statement cannot be processed.

User response

Check all operand data types to ensure that they are comparable and compatible with the statement usage.

If all the SQL statement operands are correct and accessing a view, check the data types of all the view operands.

In Hadoop tables:

  • For array columns, restructure the comparison by comparing one element of the array at a time, then resubmit the operation.
  • For row columns, restructure the comparison by comparing one element of the row at a time, then resubmit the operation.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the data type restrictions for that data source.

sqlcode: -401

sqlstate: 42818

SQL0402N The data type of an operand of an arithmetic function or operation operator is invalid.

Explanation

An invalid operand is specified for the arithmetic function or operator operator.

The statement cannot be processed.

User response

Correct the SQL statement syntax so all specified function or operator operands are valid.

A valid operand is either numeric or is capable of being implicitly cast to a numeric data type.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the operators applied to that data source.

sqlcode: -402

sqlstate: 42819

SQL0403W The newly defined alias name resolved to the object name2 which is currently undefined.

Explanation

The alias <name> has been defined upon:

  • a table, view, module, or sequence which currently is not defined in the database
  • another alias which resolves to a table, view, module, or sequence which is not defined in the database.

The object <name2> is the undefined object. This object must exist before any SQL statement (other than CREATE ALIAS) can successfully use the newly created alias. The specified alias <name> is created.

An inoperative view is considered to be undefined for the purposes of creating an alias.

User response

Ensure that the undefined object <name2> is defined prior to using the newly created alias in an SQL statement (other than CREATE ALIAS).

sqlcode: +403

sqlstate: 01522

SQL0404N A string in the UPDATE or INSERT statement is too long for column name.

Explanation

An INSERT or UPDATE statement specifies a value that is longer than the maximum-length string that can be stored in the column indicated.

The statement cannot be processed.

Note: name may or may not be returned in SQLCA, depending on the INSERT or UPDATE statement syntax.

User response

Check the length of the object column and correct the program or SQL statement so the insert or update string does not exceed the maximum length.

sqlcode: -404

sqlstate: 22001

SQL0405N The numeric literal literal is not valid because its value is out of range.

Explanation

The specified numeric literal is not in the acceptable range.

The proper ranges for SQL values are as follows:

  • For FLOAT values:
    • 0
    • In the positive range of +2.225E-307 to +1.79769E+308
    • In the negative range of -1.79769E+308 to -2.225E-307.
  • -9999999999999999999999999999999. to 9999999999999999999999999999999. for DECIMAL values
  • -2147483647 to 2147483647 for INTEGER values
  • -32768 to +32767 for small integer (SMALLINT) values.

In certain contexts the literal may have further restrictions that result in this error.

Federated system users: this range violation can be at the data source or at the federated server. The proper ranges for SQL values located in data source tables depend on the data source. To determine the correct range, see the appropriate documentation for the data source. Some data sources do not provide the appropriate values for literal. In these cases the message token will have the following format: "<data source>:UNKNOWN", indicating that the actual value for the specified data source is unknown.

Range-clustered tables: the ending value of a range definition is smaller than the starting value.

The statement cannot be processed.

User response

Reduce the literal value to the appropriate size.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the data range restrictions for that data source.

Range-clustered tables: ensure that the ending value in a range definition is greater than the starting value.

sqlcode: -405

sqlstate: 42820

SQL0406N A numeric value in the UPDATE or INSERT statement is not within the range of its target column.

Explanation

The value of a host variable or a numeric value calculated during processing of the UPDATE or INSERT SQL statement is outside the target column range. This problem may be caused by the values occurring in the object column, the SQL operation being performed on those values, or both.

The statement cannot be processed.

User response

See the explanation of message SQL0405 for ranges allowed for numeric data types except decimal floating-point.
  • For DECFLOAT(16) values:
    • 0
    • In the positive range of 1.000000000000000E-383 to 9.999999999999999E+384
    • In the negative range of -9.999999999999999E+384 to -1.000000000000000E-383
  • For DECFLOAT(34) values:
    • 0
    • In the positive range of 1.000000000000000000000000000000000E-6143 to 9.999999999999999999999999999999999E+6144
    • In the negative range of -9.999999999999999999999999999999999E+6144 to -1.000000000000000000000000000000000E-6143

These are the limits of normal decimal floating-point numbers. Valid decimal floating-point values include the special values INFINITY, -INFINITY, NAN, -NAN, SNAN, and -SNAN. These special values are illegal for all other DB2 numeric types.

NOTE: For system catalog updates, see the SQL Reference for valid ranges in various columns of updatable catalogs.

sqlcode: -406

sqlstate: 22003

SQL0407N Assignment of a NULL value to a NOT NULL column name is not allowed.

Explanation

One of the following occurred:

  • The update or insert value was NULL, but the object column was declared as NOT NULL in the table definition. Consequently:
    • NULL values cannot be inserted into that column.
    • An update cannot set values in that column to NULL.
    • A SET transition-variable statement in a trigger cannot set values in that column to NULL.
  • The update or insert value was DEFAULT, but the object column was declared as NOT NULL without WITH DEFAULT in the table definition. Consequently:
    • A default value of NULL cannot be inserted into that column.
    • An update cannot set default values of NULL in that column.
    • A SET transition-variable statement in a trigger cannot set default values of NULL in that column.
  • The column name list for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the table definition.
  • The view for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the base table definition.
  • An alter table statement attempted to alter the column with SET NOT NULL, but the existing table data contained a row with the NULL value.

If the value for name is of the form "TBSPACEID=n1, TABLEID=n2, COLNO=n3", then the column name from the SQL statement was not available when the error was issued. The values provided identify the tablespace, table, and column number of the base table that does not allow NULL value.

Federated system users: this situation can be detected by the federated server or by the data source. Some data sources do not provide the appropriate values for name. In these cases the message token will have the following format: "<data source>:UNKNOWN", indicating that the actual value for the specified data source is unknown.

HBase or Hadoop users: This situation can occur when the underlying Hadoop or HBase data is being read and one of the following happens:

  • The underlying data contained NULL in a column that is declared as NOT NULL.
  • An invalid value was encountered (which is implicitly treated as NULL) in a column that is declared as NOT NULL.

The value of name can be specified as schema-name.table-name.column-name.

The statement cannot be processed.

Under some circumstances, the token name may not be filled in (sqlerrmc field of the SQLCA not filled in).

User response

Correct the SQL statement after examining the object table definition to determine which columns of the table have the NOT NULL attribute and do not have the WITH DEFAULT attribute.

If the value for name is of the form "TBSPACEID=n1, TABLEID=n2, COLNO=n3", you can determine the table name and column name using the following query:

   SELECT C.TABSCHEMA, C.TABNAME,
          C.COLNAME 
      FROM SYSCAT.TABLES AS T,
           SYSCAT.COLUMNS AS C
      WHERE T.TBSPACEID = n1
      AND T.TABLEID = n2
      AND C.COLNO = n3
      AND C.TABSCHEMA = T.TABSCHEMA
      AND C.TABNAME = T.TABNAME

The table and column identified by this query may be the base table of a view for which the SQL statement failed.

If the error is returned as part of an alter table statement, when setting a column to NOT NULL, modify any row data for the column that contains the NULL value, and retry the statement.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the object definition for that data source. Remember that the defaults (NULL and NOT NULL) are not necessarily the same between data sources.

For HBase or Hadoop users, verify that the data in the underlying data files is correct, or use ALTER TABLE to change the nullability of the column.

sqlcode: -407

sqlstate: 23502

SQL0408N A value is not compatible with the data type of its assignment target. Target name is name.

Explanation

The data type of the value to be assigned to the column, parameter, SQL variable, or transition variable by the SQL statement is incompatible with the declared data type of the assignment target.

For Hadoop tables:

  • Array column values cannot be assigned to array variables.
  • Row column values cannot be assigned to row variables.
  • Complex type (array or row) column values and variables are not compatible for assignment.

The statement cannot be processed.

User response

Examine the statement and possibly the target table or view to determine the target data type. Ensure the variable, expression, or literal value assigned has the proper data type for the assignment target.

For a user-defined structured type, also consider the parameter of the TO SQL transform function defined in the transform group for the statement as an assignment target.

sqlcode: -408

sqlstate: 42821

SQL0409N The operand of a COUNT function is not valid.

Explanation

As specified in the SQL statement, the operand of the COUNT function does not conform to the rules of SQL syntax. Only COUNT(*) and COUNT(DISTINCT column) are allowed.

The statement cannot be processed.

User response

Specify COUNT(*) or COUNT(DISTINCT column).

NOTE: This message is only applicable to versions of DB2 prior toVersion 2 .

sqlcode: -409

sqlstate: 42607

SQL0410N A numeric value value is too long.

Explanation

The specified value is too long. A floating-point string has a maximum length of 30 characters. A decimal floating-point string has a maximum length of 42 characters.

The statement cannot be processed.

User response

Shorten the specified literal.

sqlcode: -410

sqlstate: 42820

SQL0412N Multiple columns are returned from a subquery that is allowed only one column.

Explanation

In the context of the SQL statement, a fullselect is specified that can have only one column as a result.

The statement cannot be processed.

User response

Specify only one column when only a scalar fullselect is allowed.

sqlcode: -412

sqlstate: 42823

SQL0413N Overflow occurred during numeric data type conversion.

Explanation

During processing of the SQL statement, an overflow condition arose when converting from one numeric type to another. Numeric conversion is performed according to the standard rules of SQL.

Federated system users: numeric conversion can occur at the federated server, at data sources, or both.

The statement cannot be processed. No data was retrieved, updated, or deleted.

User response

Examine the syntax of the SQL statement to determine the cause of the error. If the problem is data-dependent, it may be necessary to examine the data processed at the time of the error.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the data range restrictions for that data source.

sqlcode: -413

sqlstate: 22003

SQL0415N The data types of corresponding columns are not compatible in a fullselect that includes a set operator or in the multiple rows of a VALUES clause of an INSERT or fullselect.

Explanation

There are various statements where this error may occur.

  • It may occur within a SELECT or VALUES statement that includes set operations (UNION, INTERSECT, or EXCEPT). The corresponding columns of the subselects or fullselects that make up the SELECT or VALUES statements are not compatible.
  • It may occur within an INSERT statement that is inserting multiple rows. In this case, the corresponding columns of the rows specified in the VALUES clause are not compatible.
  • It may occur within a SELECT or VALUES statement where the VALUES clause is used with multiple rows. In this case, the corresponding columns of the rows specified in the VALUES clause are not compatible.
  • It may occur with a UNION ALL clause with two Hadoop tables, each having a column of type ARRAY.

It may occur within the array constructor, when the data type of the two values listed in the constructor are not compatible.

See Assignments and Comparisons in the SQL Reference for details on data type compatibility.

The statement cannot be processed.

User response

Correct the column names used in the SELECT statements or the expressions in the VALUES clause so that all corresponding columns are compatible types.

sqlcode: -415

sqlstate: 42825

SQL0416N You cannot specify a result column longer than 254 bytes in the SELECT or VALUES statements connected by a set operator other than UNION ALL.

Explanation

One of the SELECT or VALUES statements connected by a set operator specifies a result column that is longer than 254 bytes. VARCHAR or VARGRAPHIC result columns longer than 254 bytes can be used only with the UNION ALL set operator.

The statement cannot be processed.

User response

Either use the UNION ALL operator instead of UNION, or remove the result columns longer than 254 bytes from the SELECT or VALUES statements.

sqlcode: -416

sqlstate: 42907

SQL0417N A statement string to be prepared contains parameter markers as the operands of the same operator.

Explanation

The statement string specified as the object of a PREPARE or EXECUTE IMMEDIATE contains a predicate or expression in which parameter markers have been used as operands of the same operator without a CAST specification. For example:
    ? > ?

The statement cannot be processed.

User response

This syntax is not supported. Use a CAST specification to give at least one of the parameter markers a data type.

sqlcode: -417

sqlstate: 42609

SQL0418N The statement was not processed because the statement contains an invalid use of one of the following: an untyped parameter marker, the DEFAULT keyword, or a null value.

Explanation

This message can be encountered in many scenarios, and can be returned for multiple reasons.

Examples of reasons this message can be returned:

  • The DEFAULT keyword was specified as the only argument of a datetime arithmetic operation.
  • A parameter marker is used in a statement that is not a prepared statement. (Note that references to the PARAMETER function in the first argument of the XQuery function db2-fn:sqlquery are also considered to be parameter markers.)
  • A null value was specified as an argument of an XML function (such as XMLQUERY, for example.)
  • All result expressions of a CASE expression are untyped.

User response

Respond to this error by performing the following troubleshooting steps:

  1. Identify all instances of the following in the statement:
    • Untyped parameter markers
    • The DEFAULT keyword
    • Untyped null value
    • Untyped expressions
  2. Review reference information for the context in which any untyped parameter markers, instances of the DEFAULT keyword, untyped null values, or untyped expressions appear.
  3. Correct the syntax of the statement. Suggestions:
    • Use the CAST specification to give the untyped expressions a data type
    • Replace instances of the DEFAULT keyword with a value
  4. Execute the statement again.

sqlcode: -418

sqlstate: 42610

SQL0419N A decimal divide operation is not valid because the result would have a negative scale.

Explanation

A specified decimal division is not valid because it will result in a negative scale.

The formula used internally to calculate the scale of the result for decimal division is:

Scale of result = 31 - np + ns - ds

where np is the precision of the numerator, ns is the scale of the numerator, and ds is the scale of the denominator.

Federated system users: Decimal division can occur at the federated server, at data sources, or both. The specified decimal division results in an invalid scale for that data source.

The statement cannot be processed.

User response

Examine and ensure the precision and scale of all columns that may participate in a decimal division. Note that an integer or small integer value may be converted to a decimal for this calculation.

Federated system users: if the reason is unknown, isolate the problem to the data source failing the request and examine the data range restrictions for that data source.

sqlcode: -419

sqlstate: 42911

SQL0420N Invalid character found in a character string argument of the function function-name.

Explanation

The function function-name has a character string argument that contains a character that is not valid in a numeric SQL constant. The function may have been called as a result of using the CAST specification with function-name as the target data type or when an argument is implicitly cast to a numeric data type. The function or data type used in the SQL statement may be a synonym for function-name.

If a decimal character is specified in the DECIMAL function then that is the character that must be used in place of the default decimal character.

User response

Ensure that the character strings that are being converted to numeric types contain only characters that are valid in numeric SQL constants, using the decimal character, if specified.

sqlcode: -420

sqlstate: 22018

SQL0421N The operands of a set operator or a VALUES clause do not have the same number of columns.

Explanation

The operands of a set operator such as UNION, EXCEPT, or INTERSECT must have the same number of columns. The rows in a VALUES clause must have the same number of columns.

The statement cannot be processed.

User response

Change the SQL statement so each operand, or each row of a VALUES clause, has exactly the same number of columns.

sqlcode: -421

sqlstate: 42826

SQL0423N Locator variable variable-position does not currently represent any value.

Explanation

A locator variable is in error. Either it has not had a valid result set locator or LOB locator variable value assigned to it, the locator associated with the variable has been freed, or the result set cursor has been closed.

If variable-position is provided, it gives the ordinal position of the variable in error in the set of variables specified. Depending on when the error is detected, the database manager may not be able to determine variable-position.

Instead of an ordinal position, variable-position may have the value "function-name RETURNS", which means that the locator value returned from the user-defined function identified by function-name is in error.

User response

Correct the program or routine so that the locator variables used in the SQL statement have valid values before the statement is executed.

A LOB value can be assigned to a locator variable by means of a SELECT INTO statement, a VALUES INTO statement, or a FETCH statement.

Result set locator values are returned by the ASSOCIATE LOCATORS statements. Result set locator values are only valid as long as the underlying SQL cursor is open. If a commit or rollback operation is run, the result set locator associated with the cursor is no longer valid. If this was a WITH RETURN cursor, ensure the cursor is opened before attempting to allocate it.

If the following statements are all true about the application code:

  • the application contains a cursor declared for a query that defines a result set containing LOB columns
  • the cursor declaration contains the WITH HOLD clause
  • LOB locators are used to reference the LOB values in the result set of the cursor
  • the unit of work is committed before the cursor is closed

Do one of the following actions to remove a factor contributing to this warning case so as to successfully upgrade your application:

  • Precompile your application again using the PREP command making sure to include the SQLRULES STD option.
  • If possible, alter the application so that the LOB columns are retrieved as values instead of locators
  • If possible, alter the application so that the cursor is no longer declared with the WITH HOLD option and remove the commit before the cursor is closed.

sqlcode: -423

sqlstate: 0F001

SQL0426N Dynamic commit invalid for application execution environment.

Explanation

An application executing in a CONNECT TYPE 2 environment or Distributed Transaction Processing (DTP) environment such as CICS has attempted to execute an SQL dynamic COMMIT statement. The SQL dynamic COMMIT statement cannot be executed in this environment.

Federated system users: SQL dynamic COMMIT statements cannot be executed during a pass-through session.

User response

  • Use the commit statement provided by the DTP environment to perform the commit. For example, in a CICS environment this would be the CICS SYNCPOINT command.
  • If this statement was executed within a stored procedure, remove the statement entirely.

Federated system users: Either comment out the COMMIT statement or code it as a static statement. Then resubmit your program.

sqlcode: -426

sqlstate: 2D528

SQL0427N Dynamic roll back invalid for application execution environment.

Explanation

An application executing in a CONNECT TYPE 2 environment or Distributed Transaction Processing (DTP) environment such as CICS has attempted to execute an SQL dynamic ROLLBACK statement. The SQL dynamic ROLLBACK statement cannot be executed in this environment.

Federated system users: SQL dynamic ROLLBACK statements cannot be executed during a pass-through session.

User response

  • Use the rollback statement provided by the DTP environment to perform the rollback. For example, in a CICS environment this would be the CICS SYNCPOINT ROLLBACK command.
  • If this statement was executed within a stored procedure, remove the statement entirely.

Federated system users: Either comment out the ROLLBACK statement or code it as a static statement. Then resubmit your program.

sqlcode: -427

sqlstate: 2D529

SQL0428N The SQL statement is only allowed as the first statement in a unit of work.

Explanation

The SQL statement that was issued is required to execute before any other SQL statement that initiates a unit of work. Following are possible situations:

  • The SQL statement must be first in the unit of work and SQL has been issued against the connection within the unit of work.
  • The SQL statement must be first in the unit of work and a WITH HOLD cursor is currently open for the connection.

Note that when the statement is DISCONNECT ALL, it causes the DISCONNECT to be directed against all connections, so the request will fail if any of the connections violate the previously described restrictions.

User response

Issue a COMMIT or ROLLBACK prior to processing the SQL statement. If there are any WITH HOLD cursors, these will need to be closed. If the statement is SET INTEGRITY, remove the COMMIT THRESHOLD clause.

sqlcode: -428

sqlstate: 25001

SQL0429N The maximum number of concurrent LOB locators has been exceeded.

Explanation

A maximum of 4,000,000 concurrent LOB locators per unit of work, is supported by DB2.

User response

Modify the program so that it requires fewer concurrent LOB locators and run the program again. For example, use the FREE LOCATOR statement to free LOB locators as soon as the application no longer needs them.

sqlcode: -429

sqlstate: 54028

SQL0430N User defined function function-name (specific name specific-name) has abnormally terminated.

Explanation

An abnormal termination has occurred while the named UDF was in control.

User response

The UDF needs to be fixed. Contact the author of the UDF or your database administrator. Until it is fixed, the UDF should not be used.

sqlcode: -430

sqlstate: 38503

SQL0431N A user-defined routine, trigger, or anonymous block has been interrupted by the user. Object name: object-name. Object specific name: specific-name. Object type: object-type.

Explanation

A user interrupt or client interrupt has occurred while the routine, trigger or anonymous block was in control.

An anonymous block has no object name or specific name and is identified with an object type of "BEGIN...END".

Encountering this message might indicate some problem in the logic, such as an infinite loop or wait.

User response

If the problem persists, (that is, the need to interrupt results in the same error condition), then contact the author of the routine, trigger, or anonymous block or contact your database administrator.

sqlcode: -431

sqlstate: 38504

SQL0432N A parameter marker or null value cannot have the user defined type name or reference target type name udt-name.

Explanation

An untyped expression (parameter marker or null value) in the statement has been determined as having the user-defined type udt-name or a reference type with the target type udt-name based on the context in which it is used. An untyped expression cannot have a user-defined type or reference type as its data type unless it is part of an assignment (VALUES clause of INSERT or SET clause of UPDATE) or it is being explicitly cast to a user-defined distinct data type or reference data type using the CAST specification.

The statement cannot be processed.

User response

Use an explicit cast to the user-defined distinct data type or reference data type for the untyped expression. An alternative is to cast the columns that are user-defined distinct data types to their corresponding source data type or columns that are reference data types to their corresponding representation type.

sqlcode: -432

sqlstate: 42841

SQL0433N Value value is too long.

Explanation

The value value required truncation by a system (built-in) cast or adjustment function, which was called to transform the value in some way. The truncation is not allowed where this value is used.

The value being transformed is one of the following:
  • an argument to a user defined function (UDF)
  • an input to the SET clause of an UPDATE statement
  • a value being INSERTed into a table
  • an input to a cast or adjustment function in some other context
  • a recursively referenced column whose data type and length is determined by the initialization part of recursion and may grow in the iterative part of the recursion
  • an XML data value being serialized to the output by XMLSERIALIZE function.

The statement cannot be processed.

User response

If value is a literal string in the SQL statement, it is too long for its intended use.

If value is not a literal string, examine the SQL statement to determine where the transformation is taking place. Either the input to the transformation is too long, or the target is too short.

Correct the problem and rerun the statement.

sqlcode: -433

sqlstate: 22001

SQL0434W An unsupported value for clause clause has been replaced by the value value.

Explanation

The value that was specified for clause clause is not supported and has been replaced with the identified supported value value.

User response

No change is required if the selected value is acceptable. Otherwise, specify a value that is valid for clause.

sqlcode: +434

sqlstate: 01608

SQL0435N An invalid application defined SQLSTATE sqlstate was specified.

Explanation

The SQLSTATE value specified by the RAISE_ERROR function or on the SIGNAL or RESIGNAL statement does not conform to the rules for an application defined SQLSTATE.

User response

Correct the specified value for the SQLSTATE. The SQLSTATE value must be a character string containing exactly 5 characters. It must be of type CHAR defined with a length of 5, or type VARCHAR defined with a length of 5 or greater. The SQLSTATE value must follow the rules for application-defined SQLSTATEs.

The following are the rules for an SQLSTATE value specified on the SIGNAL or RESIGNAL statement.
  • Each character must be from the set of digits ('0' through '9') or non-accented upper case letters ('A' through 'Z').
  • The SQLSTATE class (first two characters) cannot be '00'.
The following are the rules for an SQLSTATE value specified by the RAISE_ERROR function
  • Each character must be from the set of digits ('0' through '9') or non-accented upper case letters ('A' through 'Z')
  • The SQLSTATE class (first two characters) cannot be '00', '01', or '02' since these are not error classes.
  • If the SQLSTATE class (first two characters) starts with the character '0' through '6' or 'A' through 'H', then the subclass (last three characters) must start with a character in the range 'I' through 'Z'
  • If the SQLSTATE class (first two characters) starts with the character '7', '8', '9' or 'I' though 'Z', then the subclass (last three characters) can be any of '0' through '9' or 'A' through 'Z'.

sqlcode: -435

sqlstate: 428B3

SQL0436N The terminating NULL character is missing from the C language NULL-terminated character string host variable.

Explanation

The value of an input host variable code in the C programming language requires a NULL-terminator character at the end of the string.

The statement cannot be processed.

User response

Ensure that the value of the input host variable is terminated by the NULL-terminator character.

sqlcode: -436

sqlstate: 22024

SQL0437W Performance of this complex query might be sub-optimal. Reason code: reason-code.

Explanation

Query optimization is one of the factors that affect application performance. The SQL and XQuery compiler performs several steps to produce an access plan that can be executed.

In general, this message is returned when the complexity of a query requires resources that are not available or when optimization boundary conditions were encountered.

The reason code indicates in more detail why the performance might be sub-optimal:

1

The join enumeration method was altered due to memory constraints

2

The join enumeration method was altered due to query complexity

3

Optimizer cost underflow

4

Optimizer cost overflow

5

Query optimization class was too low

6

Optimizer tolerated an inconsistent statistic

13

An optimization guideline could not be applied

15

Chosen plan materializes an intermediate result set, whose size might exceed the limit imposed by the registry variable DB2_OPT_MAX_TEMP_SIZE

16

The query contains XQuery transform expressions that are not parallelized in a database partitioned environment.

The statement will be processed.

User response

If the performance of your query is sub-optimal, perform one or more of the following actions:

  • Increase the size of the statement heap (stmtheap) in the database configuration file. After increasing the stmtheap configuration parameter, cause the statement to be recompiled. (Reason code 1)
  • Break the statement up into less complex SQL statements. (Reason codes 1, 2, 3, 4)
  • Ensure predicates do not over-specify the answer set. (Reason code 3)
  • Change the current query optimization class to a lower value. (Reason codes 1, 2, 4)
  • Issue Runstats for the tables involved in the query. (Reason codes 3, 4)
  • Change the current query optimization class to a higher value. (Reason code 5)
  • Reissue RUNSTATS for both the tables involved in the query and their corresponding indexes, that is, use the AND INDEXES ALL clause so that table and index statistics are consistent. (Reason code 6)
  • Use the Explain diagnostic facility to obtain more detailed information about why the optimization guideline could not be applied. (reason code 13).
  • If the materialization is caused by a spilling sort, try creating an index that would avoid the sort. To suppress the warning, increase the value specified by the registry variable DB2_OPT_MAX_TEMP_SIZE or unset it completely. (Reason code 15)
  • Set server options CPU_RATIO, IO_RATIO, COMM_RATE or function mapping options IOS_PER_INVOC, INSTS_PER_INVOC, IOS_PER_ARGBYTE, INSTS_PER_ARGBYTE, PERCENT_ARGBYTES, INITIAL_IOS, INITIAL_INSTS to a value that is not too high or too low. (Reason codes 3, 4)
  • Rewrite the query to parallelize the transform expressions. (Reason code 16)

sqlcode: +437

sqlstate: 01602

SQL0438N Application raised error or warning with diagnostic text: text.

Explanation

This error or warning occurred as a result of execution of the RAISE_ERROR function or the SIGNAL SQLSTATE statement in a trigger. An SQLSTATE value that starts with '01' or '02' indicates a warning.

User response

See application documentation.

sqlcode: -438, +438

sqlstate: application-defined

SQL0439N User defined function function-name is indirectly implemented by function source-function which resulted in error sqlcode.

Explanation

The function function-name was referenced in the user's statement. However, because the SOURCE clause was used in the definition of this function, it has turned out that function source-function actually implements the function. (It may be a direct or an indirect definition path from function-name to source-function.) At compile time, the encapsulator (DB2 code which acts on behalf of a function) for source-function has returned the error identified by sqlcode.

User response

The actual error situation needs to be understood better before corrective action can be taken. Look up the explanation for sqlcode. If source-function is a built-in function, the sqlcode should indicate the problem, as in the case where a built-in function is directly referenced in the user's statement. If source-function is a user defined function, the message most likely indicates a problem with one of the arguments or with the result from the function.

Correct the problem and try again.

sqlcode: -439

sqlstate: 428A0

SQL0440N No authorized routine named routine-name of type routine-type having compatible arguments was found.

Explanation

This occurs in a reference to routine routine-name, when the database manager cannot find a routine it can use to implement the reference. There are several reasons why this could occur:

  • routine-name was either incorrectly specified or does not exist in the database.
  • A qualified reference was made, and the qualifier was incorrectly specified.
  • The user's SQL path does not contain the schema to which the desired function or method belongs, and an unqualified reference was used.
  • The user's SQL path does not contain the module to which the desired routine belongs.
  • The module-qualified routine reference is made from outside the module but the module routine is not published.
  • The wrong number of arguments was included.
  • The right number of arguments was included in the function or method reference, but the data types of one or more of the arguments is incorrect.
  • Named arguments were used which do not match the parameter names of routine routine-name.
  • There are one or more routines with the same name and number of parameters declared in the current compound statement.
  • There are one or more routines with the same name declared in the outer compound statements within which the current compound statement declaring a routine is nested.
  • The routine does not exist in the database with the same function id that was used when the package was bound (applies to static statements).
  • The mutator method corresponding to an attribute assignment used in an UPDATE statement could not be found. The data type of the new value for the attribute is not a data type that is the same or promotable to the data type of the attribute.
  • The routine invoker is not authorized to execute the routine.
  • The server time was reset or changed.
  • The database was restored on a server with a different time or time zone.
  • The time associated with the members in multi-partitionned database environments is out of sync.

User response

Fix the problem and retry. This could involve catalog access, a change to the statement, a grant of the execute privilege to the routine invoker, the addition of new functions, and/or a change to the SQL path.

sqlcode: -440

sqlstate: 42884

SQL0441N Invalid use of keyword DISTINCT or ALL with function function-name.

Explanation

There are several possible causes.
  • The keyword DISTINCT or ALL was detected within the parentheses in a reference to function function-name, and the function has been resolved as a scalar function. Use of the keyword DISTINCT or ALL with a scalar function is invalid.
  • The keyword DISTINCT is used in a column function for which it is not supported. These functions include COVARIANCE, CORRELATION and the linear regression functions (those that start with REGR).
  • The function was expected to be a column function supporting the keyword ALL or DISTINCT but the function it resolved to was not a column function.

User response

  • If a scalar function is being used, then remove the keyword DISTINCT or ALL. It is invalid for a scalar function.
  • If the function is a column function that does not support the DISTINCT or ALL keywords, then remove the keywords.
  • If a column function is being used, then there is a problem with function resolution. Check your path to see if the desired function is in one of the schemas, and also check the SYSFUNCTIONS catalog for the spelling of the function name and the number and types of parameters.

Correct the error and try again.

sqlcode: -441

sqlstate: 42601

SQL0442N Error in referring to routine routine-name. The maximum number of allowable arguments (90) has been exceeded.

Explanation

Too many arguments were specified in the reference to routine routine-name. The maximum allowable is 90.

User response

Correct the statement by ensuring that the correct number of arguments has been used and try again.

sqlcode: -442

sqlstate: 54023

SQL0443N Routine routine-name (specific name specific-name) has returned an error SQLSTATE with diagnostic text text.

Explanation

This message is returned when a built-in or user-defined routine (procedure, function, or method) fails.

The contents of the third run-time token, text, varies:

  • When this message is returned because a user-defined routine failed, the contents of the third run-time token, text, is whatever was implemented by the creator of the routine.
  • In general, when this message is returned because a built-in routine failed, the contents of the third run-time token, text, will contain an embedded error code:

    Example 1 - In this example, text refers to message DBA7904N.

    [IBM][CLI Driver][DB2/AIX64] SQL0443N Routine 
    "SYSPROC.ALTOBJ" (specific name "ALTOBJ") has
    returned an error SQLSTATE with diagnostic text 
    "DBA7904, DBAD".  SQLSTATE=38553

    Example 2 - In this example, text refers to sqlcode -805.

    [IBM][CLI Driver][DB2/AIX64] SQL0443N Routine 
    "SYSIBM.SQLTABLES" (specific name "TABLES") has
    returned an error SQLSTATE with diagnostic text 
    "SYSIBM:CLI:-805".  SQLSTATE=38553
  • When this message is returned because a built-in function in the SYSFUN schema failed, the third run-time token, text, is of the following format:
    SYSFUN:nn

    where nn is a reason code having the following meaning:

    01

    Numeric value out of range

    02

    Division by zero

    03

    Arithmetic overflow or underflow

    04

    Invalid date format

    05

    Invalid time format

    06

    Invalid timestamp format

    07

    Invalid character representation of a timestamp duration

    08

    Invalid interval type

    09

    String too long

    10

    Length or position in string function out of range

    11

    Invalid character representation of a floating point number

    12

    Out of memory

    13

    Unexpected error

User response

Respond to this error in one of the following ways:

  • If this message was returned because a user-defined procedure, function, or routine failed, review any diagnostic information in the third run-time token, text, and work with the author of the procedure, function, or routine to troubleshoot the cause of the problem.
  • If this message was returned because a DB2 built-in procedure, function, or routine failed, perform the following troubleshooting steps:
    1. Determine which error code is embedded in the third run-time token, text.
    2. Refer to the details for the given sqlcode.
    3. Review additional diagnostic information, such as the values of any run-time tokens for the embedded error code, in the db2diag log files.

SQL0444N Routine routine-name (specific name specific-name) is implemented with code in library or path library-or-path, function function-code-id which cannot be accessed. Reason code: code.

Explanation

The database manager is trying to access the body of code that implements routine routine-name (specific name specific-name), and cannot access it for the reason given by reason code code (the codes are listed below). The file implementing the routine is identified by library-or-path, and the function by function-code-id.

The library name, path name, or the function name might be truncated due to a limit on the maximum available token length. The following query can be used to get the complete library path and function names from the system catalog views:

     SELECT implementation
     FROM syscat.routines
     WHERE specificname = 'specific-name'
1

Path name library-or-path is longer than the maximum (255 bytes).

2

The database manager instance path name could not be retrieved from DB2.

3

The path library-or-path could not be found.

4

The file in library-or-path could not be found, because of one of the following reasons:

  1. The routine library associated with the routine is not available in the location specified by the EXTERNAL clause in the routine CREATE statement definition.
  2. The routine library is dependent on a shared library that cannot be located (within the concatenation of directories specified in the LIBPATH environment variable in UNIX-based systems, or the PATH environment variable in Windows systems). There can be multiple levels of this indirection involved, leading to this reason code. For example, routine body X can be found, and it needs shared library Y which can also be found. But Y needs another shared library Z that cannot be located.
  3. This is a partitioned database and the library is not located in one of the partitions on which the user-defined function was run.
5

There is insufficient memory to load the library containing the function or one or more symbols could not be resolved. This reason code indicates one of the following situations:

  1. One or more symbols might not have been resolved. The routine library might be dependent on a shared library that cannot be located (using the concatenation of directories specified in the LIBPATH environment variable in UNIX-based systems, the PATH environment variable in INTEL systems).
  2. The routine has a 64-bit library which is not supported within a 32-bit instance, or, the routine has a 32-bit library or DLL within a 64-bit instance that is incompatible with the routine definition.
  3. There was insufficient memory to load the library containing the function.
6

The function function-code-id could not be found in the library that was named.

7

The symbol given as the function name (function-code-id) is not the name of a valid function in the named library.

8

The "load" system function has failed, for reasons other than those given in this message. The object file might not have been linked properly or not have been linked at all.

9

There was insufficient memory to resolve the function name function-code-id in the library identified in library-or-path.

10

The "loadquery" system call has failed. This can only happen on UNIX operating systems, and is a symptom that the database manager has not been installed correctly.

11

The agent process is searching for a particular database manager function that should be in the libdb2.a library, and it cannot find it. This can only happen on UNIX operating systems, and is a symptom that the database manager is not correctly installed.

15

System or network access has been denied. This can happen in Windows environments if the EXTERNAL NAME specification in the routine definition statement does not specify a full path, or the function does not exist in the directory called db2_installation_path\function, necessitating a search using the PATH environment variable. For example, if the PATH contains a LAN drive prior to the directory containing your function and the instance is running under the SYSTEM account, this reason code can result.

16

Multiple Java methods that could match the function function-code-id were found.

Other:

An unidentified system failure has occurred.

Federated system users: if this user defined function is a function template (and thus no code is required to reside on the federated server), consider modifying the SQL statement or statistics to enable this function to be evaluated on the remote data source.

User response

Given for each reason code:

1

Either the routine definition needs to be changed to specify a shorter path, or the database manager instance path name is too long. Analyze the routine definition within the DB2 catalog views to determine which action to take. It may be necessary to move the function body to a directory with a shorter path name.

2, 10, and 11

See your system administrator, and provide them with the full text of the appropriate reason code.

3, 6, and 7

See the routine creator or your database administrator. Provide them with the full text of the appropriate reason code. The routine definition or the location of the routine library will need to be corrected.

4

Possible solutions are grouped by the causes provided in the message explanation:

  1. Make the routine library associated with the routine available:
    • Correct the routine definition EXTERNAL clause value or verify that the routine library is in the location specified by the EXTERNAL clause.
    • For built-in routines, if you have recently updated your database to a different fix pack level that requires updating the system catalog, issue the update database to current release command to update the system catalog including the built-in routines and restart the instance.
    • Verify that the routine library can be accessed by the database manager. For fenced routines, verify that the fenced process owner has EXECUTE access permission on the library or DLL. For unfenced routines, verify that the instance owner has read access permissions on the library or DLL.
  2. The routine should be relinked or user should verify that dependent libraries are available in the LIBPATH (UNIX) or PATH (INTEL). Use the db2set command to update the LIBPATH to include the path where the library or DLL is located. For example, db2set db2libpath=/db2test/db2inst1/sqll
  3. In a partitioned database, the library associated with a user-defined function must be accessible as library-or-path on all partitions of the database. Verify that the routine library has been deployed to the function directory on all partitions of the database.
5

Possible solutions are ordered to match the causes provided in the message explanation:

  1. There can be multiple levels of this indirection involved, leading to this reason code. For example, routine body X can be found, and it requires shared library Y which is also found, however Y needs another shared library Z that cannot be located. The routine library should be relinked or the user should verify that all dependent libraries are available in the LIBPATH (UNIX) or PATH (INTEL). Use the db2set command to update the LIBPATH to include the path where the library is located. For example: db2set db2libpath=/db2test/db2inst1/sqll
  2. Use a supported library.
  3. If a lack of memory is determined then the system configuration may need to be changed to make more memory available to DB2.
8

Ensure that the module is correctly linked.

9

Contact the routine creator or your database administrator to make sure the library containing the function was correctly linked. The system configuration may need to be changed to make more memory available to database server.

15

Verify that the EXTERNAL NAME clause in the routine definition statement contains the full path, or the function exists in the directory called db2_installation_path\function.

If any of these situations is true and the error occurs due to an instance running under an account which cannot access a LAN drive prior to the directory containing your function in the PATH environment variable, you need to reconfigure the DB2 service to run under a user account that has access to all the network paths that are in the PATH environment variable.

When assigning a user account to the DB2 service, make sure that the account is granted all the required advanced user rights.

16

Verify that the library-or-path Class referenced in the EXTERNAL NAME clause in the routine definition statement contains a function function-code-id which can be resolved without ambiguity based on the SQL data-types in the routine definition statement.

If the routine was defined with PARAMETER STYLE HIVE in the routine definition statement, check the routine implementation for multiple function-code-id methods. For example, if there are multiple function-code-id methods, make sure that no two methods contain the same parameter list when those methods can use either the java.lang.String class or the org.apache.hadoop.io.Text substituted for each other.

Other:

Note the code, and see your system administrator.

Federated system users: if this user defined function is a function template (and thus no code is required to reside on the federated server), you may want to consider modifying the SQL statement or statistics to enable this function to be evaluated on the remote data source.

sqlcode: -444

sqlstate: 42724

SQL0445W Value value has been truncated.

Explanation

The value value was truncated when transformed in some way by a system (built-in) cast, adjustment, or codepage-conversion function. This is a warning situation.

The value being transformed may be one of:

  • The output of a routine (user-defined function (UDF) or method), and is being transformed because of a CAST FROM specification in the routine definition.
  • The output of a routine (user-defined function (UDF) or method) that is sourced on another function and the result needed to be transformed.
  • The output of a built-in string processing routine that needed to perform codepage conversion during processing, for example, due to a string length unit specification.

User response

Ensure that the output is as expected and that the truncation has not caused any unexpected consequences.

sqlcode: +445

sqlstate: 01004

SQL0447W The statement contains redundant specifications involving the clause clause.

Explanation

The clause keyword was included more than once in the statement. This is a warning condition.

User response

If the redundancy was intentional, or if it is determined that no harm has resulted, then no response is necessary. The type of "harm" alluded to could include, for example, the omission of some other desired keyword.

sqlcode: +447

sqlstate: 01589

SQL0448N Error in defining routine routine-name. The maximum number of allowable parameters (90 for user defined functions and methods, 32767 for stored procedures) has been exceeded.

Explanation

Too many parameters were specified when defining routine routine-name. The routine definition statement may be a CREATE FUNCTION, CREATE PROCEDURE, CREATE TYPE (method definition), or ALTER TYPE (method definition).

User response

Change the statement to include fewer parameters.

sqlcode: -448

sqlstate: 54023

SQL0449N The statement defining routine routine-name contains an invalidly formatted library/function identification in the EXTERNAL NAME clause.

Explanation

An error was found in the EXTERNAL NAME clause of the CREATE statement for user defined function (UDF), user-defined method, or procedure routine-name. The rules for the library/function identification are as follows:

For LANGUAGE C, the name takes the form '<a> or '<a>!<b>' as follows:
  • <a> is the file name containing the routine (function) to invoke
  • <b> is the entry point (function) within <a> that will be invoked as the body of the routine. If <b> is omitted, the default entry point of <a> will be used.
For LANGUAGE OLE, the name takes the form '<a>!<b>' as follows:
  • <a> is the programmatic or class identifier of the OLE object
  • <b> is the method of the object to invoke.
For LANGUAGE JAVA and LANGUAGE CLR, the name takes the form '<a>:<b>!<c>' as follows:
  • <a> is the jar identifier (LANGUAGE JAVA) or assembly file (LANGUAGE CLR) in which the class is located. '<a>:' is optional for LANGUAGE JAVA and if it is omitted the corresponding class must reside in either the function directory or the CLASSPATH.
  • <b> is the class in which the method to invoke resides
  • <c> is the method to invoke. For LANGUAGE JAVA '.<c>' can be used as an alternative to '!<c>'

For all languages, no leading or trailing blank characters are permitted between the single quotes, object identifiers, or the separating characters (for example, ' <a> ! <b> ' is invalid). Path and file names, however, may contain blanks if the platform permits.

For all file names, the file can be specified by using either the short form of the name (examples: math.a (on UNIX), math.dll (on Windows)) or the fully qualified pathname (examples: /u/slick/udfs/math.a (on UNIX), d:\udfs\math.dll (on Windows)). If the short form of the file name is used, the file must be located as follows:
  • If the platform is UNIX or the routine is a LANGUAGE CLR routine: in the function directory
  • Otherwise, if the platform is Windows: in the system PATH
File extensions (examples: .a (on UNIX), .dll (on Windows)) should always be included in the file name.

User response

Correct the problem and try again. A possible cause is the inclusion of a blank, or having the '!' or ':' at the beginning or end of the name.

sqlcode: -449

sqlstate: 42878

SQL0450N Routine routine-name (specific name specific-name) has generated a result value, SQLSTATE value, message text, or scratchpad which is too long.

Explanation

Upon return from routine routine-name (specific name specific-name), the database manager has detected that more bytes were returned than were allocated for one of the following:
  • the result value (based upon the routine definition). There are several possible causes:
    • Too many bytes were moved to the result buffer.
    • The data type is one where the data value must be delimited by a null, such as VARCHAR(n), and the delimiting null was not within the range of the defined size.
    • The database manager is expecting a two- or four- byte length value preceding the value, and this length exceeds the defined size of the result.
    • A LOB locator is returned by the routine, and the length of the LOB value associated with this locator exceeds the defined size of the result.

    The definition of the result argument in the Routine must conform to the requirement for the data type.

  • the SQLSTATE value (6 bytes including the null terminator)
  • the message text (71 bytes including the null terminator).
  • the scratchpad content (length declared on CREATE FUNCTION).

This is not permitted.

This error will also be returned if the length field of the scratchpad is altered by the routine.

User response

See your Database Administrator, or the author of the routine.

sqlcode: -450

sqlstate: 39501

SQL0451N The data-item definition, in the statement that defines routine routine-name, contains a data type type that is not appropriate for a non-sourced routine written in the given language or a routine that is defined as autonomous.

Explanation

An error was made in the data-item part of the statement defining routine routine-name. The user's statement contained the invalid type type, or it contained a user defined type (UDT) which is based on the invalid type type. The routine definition may be a CREATE FUNCTION, CREATE PROCEDURE, CREATE TYPE (method definition), or ALTER TYPE (method definition).

data-item is a token that identifies the area of the problem in the statement. For example, "PARAMETER 2" or "RETURNS" or "CAST FROM".

In an autonomous transaction, a block of statements within the transaction can be committed even if that transaction is rolled back. You can use the AUTONOMOUS keyword with the CREATE PROCEDURE command to create a procedure that will commit its work even if it is called from within a unit of work which is rolled back.

User response

Determine which situation has occurred, and take corrective action. Possible corrective actions include:

  • Changing the routine definition to a supported type; for example, from DECIMAL to FLOAT. This may involve a change in the routine body itself, and may also involve use of cast functions upon use of the routine.
  • Creating a new (suitably based) user defined type, or changing the definition of an existing UDT.

sqlcode: -451

sqlstate: 42815

SQL0452N Unable to access the file referenced by host variable variable-position. Reason code: reason-code.

Explanation

An error was encountered attempting to access or while accessing the file referenced by the "nth" host variable, where n = variable-position, for the reason given by reason-code. <variable-position> is set to 0 if the host variable position could not be determined. The possible reason codes are as follows:
  • 01 - The file name length is invalid or the file name and/or the path has an invalid format.
  • 02 - The file option is invalid. It must have one of the following values:
    SQL_FILE_READ
         -read from an existing file
    SQL_FILE_CREATE
         -create a new file for write
    SQL_FILE_OVERWRITE
         -overwrite an existing file.
          If the file does not exist,
          create the file.
    SQL_FILE_APPEND
         -append to an existing file.
          If the file does not exist,
          create the file.
  • 03 - The file cannot be found.
  • 04 - The SQL_FILE_CREATE option was specified for a file with the same name as an existing file.
  • 05 - Access to the file was denied. The user does not have permission to open the file.
  • 06 - Access to the file was denied. The file is in use with incompatible modes. Files to be written to are opened in exclusive mode.
  • 07 - Disk full was encountered while writing to the file.
  • 08 - Unexpected end of file encountered while reading from the file.
  • 09 - A media error was encountered while accessing the file.
  • 10 - An incomplete or invalid multibyte character was encountered while reading from the file.
  • 11 - An error was encountered while converting data from the file code page to the application's graphic character code page.

User response

For reason code 01, correct the file name length, file name and/or path.

For reason code 02, specify a valid file option.

For reason code 03, ensure that the file specified exists before attempting to access the file.

For reason code 04, either delete the file if it is no longer required or specify a file name that does not currently exist.

For reason code 05, ensure that the user has access (correct file permissions) to the file.

For reason code 06, either use a different file or, if the file must be accessed, modify the application to ensure that the file is not accessed concurrently.

For reason code 07, delete unnecessary files to free up disk space or specify a file that resides on another drive/file system with sufficient disk space. Also, ensure that no operating system or user file size limits were reached. If your application code page uses a multibyte encoding scheme it is possible that only part of the last character was written, ensure that the file contains only fully formed characters.

For reason code 08, if a file is to be used for input, ensure that the file is not modified before the entire file has been read.

For reason code 09, correct all errors on the media where the file resides.

For reason code 10, ensure that the file contains valid multibyte characters based on the code page of the application or submit the request while running under the same code page as the contents of the file.

For reason code 11, ensure that character conversion support between the code page of the file, for example Japanese EUC, and the graphic code page of the application, for example UCS-2, is installed.

sqlcode: -452

sqlstate: 428A1

SQL0453N A problem has been identified with the RETURNS clause in the statement that defines the routine routine-name.

Explanation

A problem casting the result of routine routine-name has been identified. The CAST FROM data type is not castable to the RETURNS data type, and it should be. See the SQL Reference for details on casting between data types.

User response

Change the RETURNS or CAST FROM clause so that the CAST FROM data type is castable to the RETURNS data type.

sqlcode: -453

sqlstate: 42880

SQL0454N The signature provided in the definition for routine routine-name matches the signature of some other routine.

Explanation

The signature of a function consists of the function name, the number of parameters defined for the function, and an ordered list of the types of the parameters.

The signature of a method consists of the method name, the subject type of the method, the number of parameters defined for the method, and an ordered list of the types of the parameters.

The signature of a procedure consists of the procedure name and the number of parameters defined for the procedure (data types are not considered).

This can occur when:

  • There already is a function or procedure (routine-name) in the schema, module, or compound SQL (compiled) statement with the same signature as the function or procedure being created. If you are altering a module to add a routine body to a defined routine prototype, the routine already has a routine body definition.
  • There already is a procedure (routine-name) in an outer compound SQL (compiled) statement with the same name as the procedure being declared.
  • There already is a method (routine-name) for the subject type with the same signature as the method specification being added or the method body being created

The statement cannot be processed.

User response

Determine if the existing routine already provides the functionality desired. If not, then the signature of the routine will have to be changed; for example, by changing the routine name.

If altering a module to add a routine body to a defined routine prototype, check that the signature matches or if the signature also needs to change and ensure that the routine name and specific name match those of the defined routine prototype. If the routine body of an existing module routine needs to be changed, alter the module to drop the routine and then alter the module to recreate the routine with the new routine body.

sqlcode: -454

sqlstate: 42723

SQL0455N In routine routine-name, the schema name schema-name1 provided for the SPECIFIC name does not match the schema name schema-name2 of the routine.

Explanation

If the SPECIFIC name is specified as a two part name, the schema-name1 portion must be the same as the schema-name2 portion of the routine-name. Note that the schema-name2 portion of routine-name may have been specified directly or it may have defaulted to the authorization ID of the statement. If the routine is a method, schema-name refers to the schema name of the subject type of the method.

User response

Correct the statement and try again.

sqlcode: -455

sqlstate: 42882

SQL0456N In the definition of routine routine-name, the SPECIFIC name specific-name already exists in the schema or module.

Explanation

The user has supplied an explicit SPECIFIC name specific-name in the definition of routine routine-name, but this name already exists as the SPECIFIC name for a function, method, or procedure in the schema or module.

User response

Choose a new SPECIFIC name and try again.

sqlcode: -456

sqlstate: 42710

SQL0457N A function, method, user-defined data type, or structured data type attribute cannot be called name since it is reserved for system use.

Explanation

The user-defined function, method, user-defined data type, or structured data type cannot be created because a specified name is reserved for use by the system. Names that cannot be used for function names, distinct type names, structured type names, or attribute names include:
  "=","<",">",">=","<=",
  "&=","&>",,"&<",
  "!=","!>","!<","<>",
  SOME, ANY, ALL, NOT, AND, OR,
  BETWEEN, NULL, LIKE, EXISTS, IN,
  UNIQUE, OVERLAPS, SIMILAR, and MATCH.

User response

Select a name for the function, method, user-defined data type, or structured data type attribute that is not reserved for system use.

sqlcode: -457

sqlstate: 42939

SQL0458N In a reference to routine routine-name by signature, a matching routine could not be found.

Explanation

In a reference to function, method, or stored procedure routine-name by signature, no matching function, method, or stored procedure could be found.

If a data type is used that can accept a parameter, then the type parameter is optional. For example, for CHAR(12), you can either specify the parameter (CHAR(12)) or omit it (CHAR()). If you specify the parameter, then the DBMS will only accept an exact match on the data type and the data type parameter. If you omit the parameter, then the DBMS will accept a match on data type only. The CHAR() syntax provides a way to tell the DBMS to ignore data type parameters when finding a matching function.

Note also that in the DROP FUNCTION/PROCEDURE, COMMENT ON FUNCTION/PROCEDURE and TRANSFER OWNERSHIP FUNCTION/PROCEDURE/METHOD statements, an unqualified reference is qualified with the statement authorization ID, and this is the schema where the problem can be found. In the SOURCE clause of a CREATE function, the qualification comes from the current path. In this case, there is no matching function in the entire path.

A function cannot be sourced on the COALESCE, DBPARTITIONNUM, GREATEST, HASHEDVALUE, LEAST, MAX (scalar), MIN (scalar), NULLIF, NVL, RID, RAISE_ERROR, TYPE_ID, TYPE_NAME, TYPE_SCHEMA, or VALUE built-in functions.

The statement cannot be processed.

User response

Possible responses include:

  • Changing the path to include the correct schema.
  • Removing parameters from the specifications of data types.
  • Using a SPECIFIC name to refer to the function or procedure instead of a signature.

sqlcode: -458

sqlstate: 42883

SQL0461N A value with data type source-data-type cannot be CAST to type target-data-type.

Explanation

The statement contains a CAST with the first operand having a data type of source-data-type to be cast to the data type target-data-type. This cast is not supported.

User response

Change the data type of either the source or target so that the cast is supported. For predefined data types these are documented in the SQL Reference. For a cast involving a user-defined distinct type, the cast can be between the base data type and the user-defined distinct type or from a data type that is promotable to the base data type to the user-defined distinct type.

sqlcode: -461

sqlstate: 42846

SQL0462W Command or routine command-or-routine-name (specific name specific-name) has returned a warning SQLSTATE, with diagnostic text text.

Explanation

An SQLSTATE of the form 01Hxx was returned to DB2 by the command or routine command-or-routine-name (with specific name specific-name), along with message text text. If command-or-routine-name is a command, then specific-name will contain the value ''*N''.

User response

The user will need to understand the meaning of the warning. See your database administrator, or the author of the routine.

sqlcode: +462

sqlstate: Valid warning SQLSTATEs returned by a user-defined function, external procedure CALL, or command invocation.

SQL0463N Routine routine-name (specific name specific-name) has returned an invalid SQLSTATE state, with diagnostic text text.

Explanation

The valid SQLSTATEs that a routine can return are 38xxx (error), 38502 (error) and 01Hxx (warning). This routine routine-name (specific name specific-name) returned an invalid SQLSTATE state, along with message text text. The routine is in error.

User response

The routine will need to be corrected. See your database administrator, or the author of the routine. The application significance of the bad SQLSTATE can also be learned from the routine author.

sqlcode: -463

sqlstate: 39001

SQL0464W Procedure procedure-name returned generated-nbr-results query result sets, which exceeds the defined limit max-nbr-results.

Explanation

The stored procedure named by procedure-name completed normally. However, the stored procedure exceeded the defined limit on the number of query result sets the procedure can return.

generated-nbr-results
identifies the number of query result sets returned by the stored procedure.
max-nbr-results
identifies the defined limit on the number of query result sets for the stored procedure.

Only the first max-nbr-results query result sets are returned to the SQL program that issued the SQL CALL statement.

The possible causes are as follows:
  • The stored procedure is unable to return generated-nbr-results result sets due to the DRDA limitations imposed by the client. The DRDA client establishes this limit with the MAXRSLCNT DDM code point.
  • The procedure was called from a C application. The processing of result sets is not supported for C, so the result set is simply closed before returning to the C application.

User response

The SQL statement is successful. The SQLWARN9 field is set to 'Z'.

sqlcode: +464

sqlstate: 0100E

SQL0465N Unable to start, initialize, or communicate with fenced mode process. Reason code code.

Explanation

There is a system related problem involved with the running of a fenced mode routine (user-defined function or method). The exact nature of the problem is indicated by code. This is NOT a user problem. Possible reason codes are:

Routine process errors
21:
Failure to initialize internal data or application data.
22:
Failure to register signal handlers.
23:
Failure to grant agent process the access permission for the REQUEST QUEUE.
24:
Failure to connect to the routine process Shared Memory.
25:
Failure to open the REPLY QUEUE.
26:
Failure to write to the REPLY QUEUE.
27:
Failure to create the REQUEST QUEUE.
28:
Failure to read from the REQUEST QUEUE.
29:
Routine process dies.
30:
Routine process catches an USER INTERRUPT signal.
31:
Failure to unload routine module.
32:
Failure to allocate storage for control blocks used in module loading/unloading.
33:
Failure to send SIGINT from agent process to routine process.
34:
Failure to initialize OLE library.
35:
Failure to initialize OLE DB Initialization Service Component.
40:
Internal error occurred in routine process.
Agent process errors
41:
Failure to spawn routine process.
42:
Failure to create the REPLY QUEUE.
43:
Failure to read from the REPLY QUEUE.
44:
Failure to open the REQUEST QUEUE.
45:
Failure to write to the REQUEST QUEUE.
47:
Failure to grant the routine process the access permission to the UDFP shared memory set.
48:
Failure to grant the routine process the access permission to the REPLY QUEUE.
49:
Failure to allocate storage for control blocks used in module loading/unloading.
50:
Agent process died while running routine code or agent code.
51:
Agent process catches USER INTERRUPT while running un-fenced routine code.
60:
Internal error occurred in routine process.

User response

Contact your Database or System administrator.

sqlcode: -465

sqlstate: 58032

SQL0466W The procedure procedure-name returns number-results result sets from the stored procedure.

Explanation

This message is returned as a result of issuing a CALL SQL statement. It indicates that the stored procedure procedure-name has number-results result sets associated with it.

The statement completed successfully.

User response

None required.

sqlcode: +466

sqlstate: 0100C

SQL0467W The procedure procedure-name includes another result set. There are a total of max-nbr-results result sets.

Explanation

This message is returned as a result of closing a cursor. It indicates that another result set exists for stored procedure procedure-name and the cursor was re-opened on the next result set. There are a total of max-nbr-results result sets from the stored procedure.

The statement completed successfully.

User response

None required. Fetches can proceed on to the next result set.

sqlcode: +467

sqlstate: 0100D

SQL0469N The parameter mode OUT or INOUT is not valid for a parameter in the routine named routine-name with specific name specific-name (parameter number number, name parameter-name).

Explanation

A parameter in an SQL procedure is declared as OUT and the corresponding argument is not a valid assignment target. For functions only, a parameter is declared as OUT or INOUT and the corresponding argument is not an SQL variable, global variable, or SQL parameter.

A constant or an expression is an example of an invalid argument for OUT or INOUT parameters.

For example, if a function named my_function was declared to have one OUT parameter, the following function call is not valid because the argument that is passed to the OUT parameter cannot have values assigned to it:

SET my_variable = my_function( 1 + 2 );

User response

If calling an SQL procedure, change the output argument to a valid assignment target. If invoking a function, change the OUT or INOUT argument to an SQL variable, global variable, or SQL parameter.

sqlcode: -469

sqlstate: 42886

SQL0470N The user defined routine routine-name (specific name specific-name) has a null value for argument argument that could not be passed.

Explanation

A routine has an input argument with a null value but was defined with a parameter style that does not pass null indicators, or the data type of this parameter does not support null values.

User response

If the routine is to be called with null values, ensure the parameter style and input types are capable of accepting a null value. For functions, the function could also be created with "RETURNS NULL ON NULL INPUT".

sqlcode: -470

sqlstate: 39004

SQL0471N Invocation of routine name failed due to reason reason-code.

Explanation

The invocation of routine name failed. Use reason code reason-code to find out more details about the cause of the failure.

User response

If the reason code starts with "DSNX9":
  • The routine was invoked on a DB2 Universal Database for z/OS server. A DSNX9xx message describing the error might be displayed on the server's system console. Consult the documentation for the DB2 UDB for z/OS server and correct the condition described by the reason code.
Else, the following lists the action to take for the indicated reason code:
1
The invocation failed because the SQL routine was created on a previous release of the product and the DBMS was not able to migrate it to the current release. The routine must be dropped and re-created to become operative again.

sqlcode: -471

sqlstate: 55023

SQL0472N One or more cursors were left open by function or method routine-name (specific name specific-name).

Explanation

The function or method routine-name (specific name specific-name) did not close all its open cursors before the invoking statement completed. Functions and methods must close all cursors before the invoking statement completes.

User response

Consult with the developer of the function or method. The function or method must be rewritten to ensure that all cursors are closed before the invoking statement completes.

sqlcode: -472

sqlstate: 24517

SQL0473N A user-defined data type could not be created because the specified name for the new data type is the same as the name of an existing, built-in data type.

Explanation

This message is returned when an attempt is made to either create a user-defined data type or to upgrade a database having a user-defined data type with a name that is the same name of a built-in data type.

User response

To create a new user-defined data type, re-issue the statement using a non-reserved data type name.

To upgrade a database which has a user-defined data type with the same name as a built-in data type in the new product version, perform the following steps:

  1. Drop the user-defined data type which has the name conflict and drop database objects that reference this data type.
  2. Re-create the data type using a non-reserved data type name and then re-create the other dropped objects.
  3. Upgrade the database.

sqlcode: -473

sqlstate: 42918

SQL0475N The result type (type-1) of the SOURCE function cannot be cast to the RETURNS type (type-2) of the user defined function function-name.

Explanation

In order for the CREATE of a sourced user defined function (UDF) to be valid, the result type (type-1) of the source function must be castable to the RETURNS type (type-2) of the function being created. There is no supported cast between these data types. See the SQL Reference for details on casting between data types.

User response

Change the RETURNS data type or the SOURCE function identification so that the result type of the SOURCE function is castable to the RETURNS data type.

sqlcode: -475

sqlstate: 42866

SQL0476N Reference to routine function-name was made without a signature, but the routine is not unique in its schema.

Explanation

References to a function or stored procedure without a signature is permitted, but the named function or store procedure function-name must be unique in its schema and is not. If the routine is a method, a reference without a signature is permitted but this named method must be unique for the data type.

Note that in the DROP FUNCTION/PROCEDURE and COMMENT ON FUNCTION/PROCEDURE statements, an unqualified reference is qualified with the statement authorization ID, and this is the schema where the problem can be found. In the SOURCE clause of a CREATE FUNCTION, the qualification comes from the current path. In this case, the first schema in the path containing a function with this name had other functions by the same name.

Federated system users: For a pass-through session, if the statement is a CREATE FUNCTION MAPPING statement, this error indicates that an attempt was made to create a function mapping from one remote function to more than one local function.

User response

Correct the reference by one of the following:
  • completing the signature
  • using the SPECIFIC name of the desired routine
  • changing the SQL path

and try again.

sqlcode: -476

sqlstate: 42725

SQL0478N The statement failed because one or more dependencies exist on the target object. Target object type: object-type1. Name of an object that is dependent on the target object: object-name. Type of object that is dependent on the target object: object-type2.

Explanation

When object B is said to be dependent on object A, actions taken on object A could significantly affect object B. For example, when you drop a table any objects that are directly or indirectly dependent on that table could be either deleted or made inoperative. Because of these possible outcomes for dependent objects, some types of actions fail if there are dependencies on the object that is target of the action.

This message is returned when an attempt to drop, alter, transfer ownership of, or revoke privileges on a target object fails because other objects directly or indirectly depend on that target object.

Examples of scenarios in which this message can be returned:

  • If object-type1 is ALIAS, the dependencies for DROP might include a row permission or a column mask which references this alias.
  • If object-type1 is SYNONYM, the dependencies for DROP might include a row permission or a column mask which references this synonym.
  • If object-type1 is VIEW, the dependencies for DROP might include a row permission or a column mask which references this view.
  • If object-type1 is TABLE:
    • Dependencies for DROP might include a row permission or a column mask which references this table.
    • A system-period temporal table might exist that uses this table as the corresponding history table.
    • If object-type2 is INDEX, there might be an expression-based index that depends on the columns of the table.
  • If object-type1 is TABLESPACE, a system-period temporal table might exist for which the corresponding history table resides in this table space.
  • For a DB2 for z/OS server, if object-type1 is DATABASE, a system-period temporal table might exist for which the corresponding history table resides in this database.

User response

  1. Determine which objects have direct or indirect dependencies on the target object by using one or both of the following methods:
    • Consult the system catalogs.
    • Use the GET_DEPENDENCY procedure.
  2. Remove the dependencies that blocked the statement.
  3. Reissue the statement.

sqlcode: -478

sqlstate: 42893

SQL0480N The procedure procedure-name has not yet been called.

Explanation

Either the procedure identified in an ASSOCIATE LOCATORS statement has not yet been called within the application process, or the procedure has been called, but an explicit or implicit commit occurred before the statement.

User response

Correct the statements so that the exact syntax used to specify the procedure name on the CALL statement is the same as that on the ASSOCIATE LOCATORS statement. If an unqualified name is used to CALL the procedure, the one-part name must also be used in the other statements. Reissue the statements.

sqlcode: -0480

sqlstate: 51030

SQL0481N The GROUP BY clause contains element-1 nested within element-2.

Explanation

The following types of nesting are not allowed within a GROUP BY clause:
  • CUBE within CUBE, ROLLUP, or GEL
  • ROLLUP within CUBE, ROLLUP, or GEL
  • () within CUBE, ROLLUP, or GEL
  • GROUPING SETS within GROUPING SETS, CUBE, ROLLUP, or GEL
  • CUBE, ROLLUP, (), GROUPING SETS within any function, CASE expression, or CAST specification where GEL represents the element shown as grouping-expression-list in the syntax diagram of the GROUP BY clause.

where GEL represents the element shown as grouping-expression-list in the syntax diagram of the GROUP BY clause.

In some instances the value “---” will be shown for element 2. In this case “---” represents one of CUBE, ROLLUP, GROUPING SETS, or GEL.

The statement cannot be processed.

User response

Modify the GROUP BY clause to remove the nesting.

sqlcode: -481

sqlstate: 428B0

SQL0483N In the CREATE for user defined function function-name statement, the number of parameters does not match the number of parameters of the SOURCE function.

Explanation

An attempt is being made to CREATE a user defined function function-name which is sourced on another function. One of the following situations has been identified:
  • The SOURCE clause uses a function-name (input parameter list) to identify the source function, and the number of types in the list is different from the number of parameters of the function being created.
  • The SOURCE clause uses different syntax to identify the source function, and the number of types of that function is different from the number of parameters of the function being created.

User response

The number of parameters for the SOURCE function and for the function being created must be the same. The identification of the SOURCE function needs to be changed, to
  • fix the input parameter list
  • correct the function name or function specific name to identify the proper function.

It is also possible that the path needs to be corrected in order for correct function resolution to occur.

sqlcode: -483

sqlstate: 42885

SQL0486N The BINARY and VARBINARY data types are currently only supported internally.

Explanation

One or more of the data types in the statement is BINARY or VARBINARY. This is not supported in the current version of DB2.

User response

Change the data type(s) then resubmit the statement.

sqlcode: -486

sqlstate: 42991

SQL0487N Routine routine-name (specific name specific-name) attempted to execute an SQL statement.

Explanation

The program used to implement the body of a routine is not allowed to execute SQL statements. This routine routine-name (specific name specific-name) contains SQL statements or this routine calls a procedure that uses SQL statements, such as the SYSPROC.ADMIN_CMD procedure.

User response

Remove any SQL statements then recompile the program. Investigate the level of SQL allowed as specified on the statement defining the routine.

sqlcode: -487

sqlstate: 38001

SQL0489N The function function-name in a SELECT or VALUES list item has produced a BOOLEAN result.

Explanation

The function function-name is defined for use as a predicate, returning a boolean result. Such a result is not valid in a select list.

The statement cannot be processed.

User response

Correct the function name or remove the use of the function.

sqlcode: -489

sqlstate: 42844

SQL0490N Number number directly specified in an SQL statement or command is outside the range of allowable values in this context (minval,maxval).

Explanation

A number (number) was specified that is not valid in the context in which it was specified. The minimum allowed value in this context is minval. The maximum allowed value in this context is maxval. n must be within the range specified by minval and maxval (minval =< n => maxval).

If creating or altering a table space, the minimum and maximum values may be dependant on the page size of the table space. Refer to the SQL Reference for more details on table space limits.

User response

Change the value n to a valid value in the statement or command.

sqlcode: -490

sqlstate: 428B7

SQL0491N The CREATE FUNCTION or ALTER MODULE statement used to define routine-name must have a RETURNS clause, and one of: the EXTERNAL clause (with other required keywords); an SQL function body; or the SOURCE clause.

Explanation

A required clause is missing in the definition of routine routine-name. If EXTERNAL was specified, one of the following clauses must also be specified: LANGUAGE, PARAMETER STYLE.

If defining an SQL function, the SQL function body must be included unless using the PUBLISH action of ALTER MODULE to define an SQL function prototype.

User response

Add the missing clause, and then try again.

sqlcode: -491

sqlstate: 42601

SQL0492N There is a problem in the CREATE for user defined function function-name, with parameter number number. It may involve a mismatch with a SOURCE function.

Explanation

The parameter in position number of function function-name is in error and the CREATE cannot be performed. The parameter in position number of the source function is not castable to the corresponding parameter of the function being created.

User response

Possible corrections include:
  • Identify a different source function.
  • Change the data type of the parameter of the function being created so that the data type of the source function can be cast to this data type.

sqlcode: -492

sqlstate: 42879

SQL0493N Routine routine-name (specific name specific-name) has returned a date, time or timestamp value which is syntactically or numerically invalid.

Explanation

The body of user defined function (UDF) or method routine-name (specific name specific-name) has returned an invalid date, time or timestamp value.

An example of a syntactically invalid date value is '1994-12*25': the '*' should be a '-'. An example of a numerically invalid time value is '11.71.22': there is no 71st minute in the hour.

User response

The routine needs fixing. See your DBA, or the author of the routine.

sqlcode: -493

sqlstate: 22007

SQL0494W The number of result sets is greater than the number of locators.

Explanation

The number of result set locators specified on the ASSOCIATE LOCATORS statement is less than the number of result sets returned by the stored procedure. The first “n” result set locator values are returned, where “n” is the number of result set locator variables specified on the SQL statement.

The SQL statement is successful. The SQLWARN3 field is set to 'Z'.

User response

Increase the number of result set locator variables specified on the SQL statement.

sqlcode: +494

sqlstate: 01614

SQL0495N Estimated processor cost of estimate-amount1 processor seconds (estimate-amount2 service units) in cost category cost-category exceeds a resource limit error threshold of limit-amount service units.

Explanation

The prepare of a dynamic INSERT, UPDATE, DELETE, or SELECT SQL statement resulted in a cost estimate that exceeded the error threshold value specified in the resource limit specification table (RLST).

This error is also issued if DB2's cost category value was "B", and the default action specified in the RLF_CATEGORY_B column in the RLST is to issue an error.
estimate_amount1
The cost estimate (in processor seconds) if the prepared INSERT, UPDATE, DELETE or SELECT statement were to be executed.
estimate_amount2
The cost estimate (in service units) if the prepared INSERT, UPDATE, DELETE or SELECT statement were to be executed.
cost-category
DB2's cost-category for this SQL statement. The possible values are A or B.
limit-amount
The error threshold (in service units) specified in the RLFASUERR column of the RLST.

The prepare of the dynamic INSERT, UPDATE, DELETE, or SELECT statement was unsuccessful.

User response

If this SQLCODE was returned because the cost category value is "B", it might be that the statement is using parameter markers or that some statistics are not available for the referenced tables and columns. Make sure the administrator has run the utility RUNSTATS on the referenced tables. It might also be that UDFs will be invoked when the statement is executed, or for INSERT, UPDATE, or DELETE statements that triggers are defined on the changed table. Check the DSN_STATEMNT_TABLE or the IFCID 22 record for this statement to find the reasons this SQL statement has been put in cost category "B". If the program cannot be changed, or if statistics cannot be obtained, ask the administrator to change the value in the RLF_CATEGORY_B column in the RLST to "Y" which allows the statement to execute or "W" which returns a warning instead of an error.

If the warning is caused by an SQL statement that is consuming too much processor resource, attempt to rewrite the statement to perform more efficiently. Another option is to ask the administrator to increase the error threshold value in the RLST.

sqlcode: -495

sqlstate: 57051

SQL0499N Cursor cursor-name has already been assigned to this or another result set from procedure procedure-name.

Explanation

An attempt was made to assign a cursor to a result set but multiple cursors have been allocated for procedure procedure-name.

User response

Determine if the target result set was previously assigned to a cursor. If multiple cursors have been allocated for procedure procedure-name ensure that only one cursor is used to process the result sets of a stored procedure.

sqlcode: -499

sqlstate: 24516