Indicates whether trailing binary zeroes must be truncated from binary columns values.
Driver
The DataFlex SQL Drivers (SQL Server, DB2 and ODBC), revision 5 and higher
Boolean, temporary
Read/Write
True, False
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}
Some back-ends will return binary data completely filled out with binary zeroes. If you store hex value "AE003400" in a column of 6 positions, you would see "AE0034000000" when retrieving the column.
It is possible to switch on truncation of trailing binary zeroes. This will however also truncate trailing zeroes that are actually part of the column value. Storing the hex value "AE003400" in a column of 6 positions would give "AE0034" when retrieving the column.
You can turn on truncating of trailing zeroes by setting this attribute to true.
This default value is copied to database level when logging in to the database. The actual value in use for an active connection is that on database level. This attribute merely reflects a default.
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
The sample code above shows the current setting for a given database.