Controls behavior when character data is truncated at the client side.
A temporary setting for the current user is established by SAP Open Client and jConnect TDS connections ('On').
|PUBLIC role||For current user||For other users|
|Allowed to set permanently?||Yes, with SET ANY PUBLIC OPTION||Yes||Yes, with SET ANY PUBLIC OPTION|
|Allowed to set temporarily?||Yes, with SET ANY PUBLIC OPTION||Yes (current connection only)||No|
The ansi_blanks option has no effect unless the database ignores trailing blanks in string comparisons and pads strings that are fetched into character arrays. It forces a truncation error whenever a value of data type CHAR(N) is read into a C char[M] variable for values of N greater than or equal to M. With ansi_blanks set to Off, a truncation error occurs only when at least one non-blank character is truncated.
For Embedded SQL with the ansi_blanks option set to On, when you supply a value of data type DT_STRING, you must set the sqllen field to the length of the buffer containing the value (at least the length of the value plus space for the terminating null character). With ansi_blanks set to Off, the length is determined solely by the position of the NULL character. The value of the ansi_blanks option is determined when the connection is established. Changing the option once the connection has been made does not affect this sqllen Embedded SQL behavior.
When a database is blank padded, this option controls truncation warnings sent to the client if the expression being fetched is CHAR or NCHAR (not VARCHAR or NVARCHAR) and it is being fetched into a char or nchar (not VARCHAR or NVARCHAR) host variable. If these conditions hold and the host variable is too small to hold the fetched expression once it is blank padded to the expression's maximum length, a truncation warning is raised and the indicator contains the minimum number of bytes required to hold the fetched expression if it is blank padded to its maximum length. If the expression is CHAR(N) or NCHAR(N), the indicator may be set to a value other than N to take into account character set translation of the value returned and character length semantics.