IBM Support

nzsql error, Character width exceeded

Question & Answer


Question

What does the message "ERROR: 15 : Character width exceeded" mean?

Answer

The error message:

   ERROR:  15 : Character width exceeded

can be reproduced in the following example:

create table tab1 (c1 int, c2 varchar(10));
create table tab2 (c1 int, c2 varchar(15));
insert into tab2 values (1,'abcdefghijklmno');
insert into tab1 select * from tab2;

The error occurs because we are attempting to insert the value 'abcdefghijklmno', which has a length of 15 characters, into a column which is defined as a varchar(10). The reference to 15 in the error message refers to the length of the string attempted to be inserted.  For example, if the insert was a 12 character string the error message would be:

ERROR:  12 : Character width exceeded

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Database","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ811794

Document Information

Modified date:
17 October 2019

UID

swg21567647