Treat Binary Data as Character Data
- Last Updated: February 11, 2021
- 1 minute read
- DataDirect Connectors
- ODBC
- MySQL 8.0
- Documentation
Attribute
TreatBinaryAsChar (TBAC)
Purpose
Specifies whether the driver describes and returns native Binary or Varbinary data as Char and Varchar, respectively.
Valid Values
0 | 1
Behavior
If set to 1 (Enabled), the driver describes and returns
data that MySQL stores as BINARY or VARBINARY as CHAR or VARCHAR values, respectively.
If set to 0 (Disabled), the driver describes and returns
data that MySQL describes as BINARY or VARBINARY as BINARY or VARBINARY values,
respectively.
Example
When TreatBinaryAsChar=1, if you attempt to run a query
against a column of Binary type that contains a value "abc", the driver returns a Char value
"abc" instead of a Binary value "616263".
Default
0 (Disabled)