Copying Character Data When you copy data, you must ensure that the buffers are of adequate size to hold the data. If the destination buffer is not large enough for the multibyte data in the source buffer, the data might be truncated during the copy. For example, the following ESQL/C code fragment copies the multibyte data A1A2A3B1B2B3 from buf1 to buf2:
If the client and database locales are different (and convertible), the application might need to expand this value. For example, if the fname column is defined as CHAR(8), the following ESQL/C code fragment selects an 8-byte character value into the 10-byte buf1 host variable:
To avoid this situation, make sure that you define buffers to handle the maximum character-expansion possible, 4 bytes, in the conversion between your client and database code sets.