The string data type
The string data type is the data type that holds character data that is null terminated and does not contain trailing blanks.
However, if a string of blanks (that is, ‘ ’) is stored in a database field and selected into a host variable of the string data type, the result is a single blank character.
When an application reads a value from a CHAR column into a host variable of the string data type, it strips the value of any trailing blanks and appends a null terminator. The behavior is the same if an application reads a value from a VARCHAR column into a host variable of the string data type.
EXEC SQL BEGIN DECLARE SECTION;
string buffer[16];
EXEC SQL END DECLARE SECTION;
⋮
EXEC SQL select lname into :buffer from customer
where customer_num = 102;
EXEC SQL BEGIN DECLARE SECTION;
string str_name[n + 1];
EXEC SQL END DECLARE SECTION;