DB2 - Problem description
Problem IT29945 | Status: Closed |
10 CHAR VALUE CAN BE INSERTED INTO VARGRAPHIC(5 CODEUNITS32). THIS SHOULD FAIL WITH SQL0433N ERROR. | |
product: | |
DB2 FOR LUW / DB2FORLUW / B50 - DB2 | |
Problem description: | |
When a column is defined as VARGRAPHIC with string length unit CODEUNITS32, it's possible to insert longer-than-allowed values. For example: create table T (c1 graphic(5 codeunits32), c2 vargraphic(5 codeunits32) ); insert into T values ('abcdefghij','abcdefghij'); DB20000I The SQL command completed successfully. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * all * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 v11.5.4.0 or higher * **************************************************************** | |
Local Fix: | |
In the INSERT statement, explicitly cast constant values to VARGRAPHIC, e,g.: insert into T values (VARGRAPHIC('abcdefghij'),VARGRAPHIC('abcdefghij')); SQL0433N Value "abcdefghij" is too long. SQLSTATE=22001 Alternatively, enable the statement concentrator, this replaces the constant value with a parameter marker: db2 update db cfg for using stmt_conc literals | |
Solution | |
Workaround | |
not known / see Local fix | |
BUG-Tracking | |
forerunner : IT29935 follow-up : | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 08.08.2019 30.06.2020 30.06.2020 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) |