Issue 32057 — Empty field (spaces) are wrongly calculated as 2 chars instead of 2 bytes AS/400
Status: Solved in 10.4.01
Solution available in patch(es): 10.3.02.025
Summary: Empty field (spaces) are wrongly calculated as 2 chars instead of 2 bytes AS/400 Environment: +Uniface: * Version 10.3.01 (and higher) +Operating System: * iSeries +Database: * DB2 Symptoms: On iSeries a field of type string with packing code W translates in to a field of type GRAPHIC with CCSID 1200 (=UTF16). That means all characters are two bytes long. If the assignment switch NULLDEFAULT is set to N then the field is filled with blanks if it is empty. The problem is with this filling out: it incorrectly uses the number of bytes as the length of the data to pass the the database. It should be passing the nr of characters, which is nr bytes / 2. Because the field is filled completely with spaces the nr of bytes of the data is set to the fieldlength in bytes, but DB2 interprets this number as the number of characters, doubles it to get the nr of bytes and then complains that the data doesn't fit in the field.
There is no workaround for this issue.
This problem is fixed. This problem is fixed.