Open matthew-wozniczka opened 7 years ago
First off, I don't think that the fixed-length comment in SQLGetData was intended to apply to fixed length character/binary columns; only to types that can't reasonably be retrieved in parts (i.e., bool, int, float, etc.)
So if you have a column of type Char(256), you should be able to call SQLGetData to retrieve the data, say, 50 characters at a time.
SQL_ATTR_LENGTH_EXCEPTION_BEHAVIOR should only apply to types that can be fetched in parts. So, again, you should be able to bind a Char(256) to a buffer of that holds 50 characters, and with SQL_ATTR_LENGTH_EXCEPTION_BEHAVIOR = SQL_LE_REPORT you can get SQL_MORE_DATA and fetch the remainder using SQLGetData.
So SQL_ATTRL_LENGTH_EXCEPTION_BEHAVIOR should apply to fixed- or variable-length string or binary data.
Driver Manager shouldn't care about this setting, but make sure it doesn't affect an ARD consistency checks (i.e., that SQL_ATTR_LENGTH_EXCEPTION_BEHAVIOR is something other than the default for a non-string and non-binary type.
Clarified in spec that SQLGetData can be used with any character or binary type, as can SQL_ATTR_LENGTH_EXCEPTION.
Dean, please verify this is the current supported behavior in the Driver Manager.
The current documentation for SQLGetData states:
Does this carry over to the
SQL_LE_REPORT
feature?The current text of section _3.8.1 (SQL_ATTR_LENGTH_EXCEPTIONBEHAVIOR) mentions 'string' & 'binary', but it's not clear if it's referring to the source type or the target type (or both?).
If not, I assume that truncations involving a fixed-length source type will still cause errors (... which may then be intercepted via
SQL_ATTR_TYPE_EXCEPTION_BEHAVIOR = SQL_TE_REPORT_EXCEPTION
)?