If an output string does not fit into a buffer, DB2® UDB CLI truncates the string to a length that is one less than the size of the buffer, and writes the null terminator. If truncation occurs, the function returns SQL_SUCCESS_WITH_INFO and an SQLSTATE by indicating truncation. The application can then compare the buffer length to the output length to determine which string is truncated.
For example, if SQLFetch() returns SQL_SUCCESS_WITH_INFO, and an SQLSTATE of 01004, at least one of the buffers bound to a column is too small to hold the data. For each buffer that is bound to a column, the application can compare the buffer length with the output length and determine which column is truncated.