Detecting String Truncation Using Indicator Variables
If you application retrieves a character string into a host variable that is too small to hold the string, the DBMS Server truncates the string to fit into the host variable. If you specify an indicator variable with the host variable, the indicator variable is set to the original length of the data. You can detect truncation by comparing the value of the indicator variable with the length of the string that was retrieved: if the indicator variable is greater than the length, the string was truncated.