DF_DRIVER_TRUNCATE_BINARY_ZEROES
Indicates whether trailing binary zeroes must be truncated from binary column values.
Level
Driver
Supported by
The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.
Type
Boolean, temporary
Access
Read/Write
Values
- True
- False
Syntax
Use cli.pkg
Get_Attribute DF_DRIVER_TRUNCATE_BINARY_ZEROES of {driverNumber} to {BooleanVariable}
Set_Attribute DF_DRIVER_TRUNCATE_BINARY_ZEROES of {driverNumber} to {True|False}
Driver Configuration Keyword
Remarks
Some back-ends will return binary data completely filled out with binary zeroes. For example, if you store the hex value "AE003400" in a column of 6 positions, you would see "AE0034000000" when retrieving the column.
It is possible to enable truncation of trailing binary zeroes. However, this will also truncate trailing zeroes that are part of the column value. For instance, storing the hex value "AE003400" in a column of 6 positions would result in "AE0034" when retrieving the column.
You can enable truncation of trailing zeroes by setting this attribute to true.
The default value is copied to the database level when logging in to the database. The actual value in use for an active connection is that at the database level. This attribute merely reflects a default.
Sample Code
The sample code below shows the current setting for a given database.
Function DriverIndex String sDriver Returns Integer
String sCurrentDriver
Integer iNumberOfDrivers iDriver iCount
Move 0 to iDriver
Get_Attribute DF_NUMBER_DRIVERS to iNumberOfDrivers
For iCount From 1 To iNumberOfDrivers
Get_Attribute DF_DRIVER_NAME of iCount To sCurrentDriver
If (Uppercase(sCurrentDriver) = Uppercase(sDriver)) Begin
Move iCount to iDriver
End
Loop
Function_Return iDriver
End_Function // DriverIndex
Procedure ShowDriverAttribute
Boolean bAttribValue
Integer iDriver
Get DriverIndex "MSSQLDRV" To iDriver
Get_Attribute DF_DRIVER_TRUNCATE_BINARY_ZEROES of iDriver to bAttribValue
Showln "Truncate trailing zeroes: " (If(bAttribValue, "YES", "NO"))
End_Procedure