The threshold, in Mb, that makes a column to be eligible for JIT binding (default 10 Mb).
Database
The DataFlex SQL Drivers (SQL Server, DB2 and ODBC), revision 5 and higher
Integer, temporary
Read/Write
0..
Use cli.pkg
Get_Attribute DF_DATABASE_JIT_THRESHHOLD of {driverNumber} {databaseHandle} to {IntegerVariable}
Set_Attribute DF_DATABASE_JIT_THRESHHOLD of {driverNumber} {databaseHandle} to {IntegerVariable}
The threshold, in Mb, that makes a column to be eligible for JIT binding (default 10 Mb). See JIT Binding for more information.
Function DriverIndex String sDriver Returns Integer
String sCurrentDriver
Integer iDriver
Integer iNumDrivers
Get_Attribute DF_NUMBER_DRIVERS To iNumDrivers
For iDriver From 1 To iNumDrivers
Get_Attribute DF_DRIVER_NAME of iDriver to sCurrentDriver
If (Uppercase(sDriver) = Uppercase(sCurrentDriver)) ;
Function_Return iDriver
Loop
Function_Return 0
End_function // DriverIndex
Procedure ShowJITColumns
Handle hTable
String sTable
Boolean bJITBinding
Handle hDatabase
String sDriver
Integer iDriver
Integer iTreshold
Integer iColumn
Integer iNumColumns
Integer iNumJITColumns
Integer iNativeLength
String sColumn
Move 0 To hTable
Get_Attribute DF_FILE_NEXT_USED of hTable To hTable
While (hTable <> 0)
Open hTable
Get_Attribute DF_FILE_LOGICAL_NAME Of hTable To sTable
Get_Attribute DF_FILE_DRIVER Of hTable To sDriver
If (sDriver = "MSSQLDRV") Begin
Get_Attribute DF_FILE_JIT_BINDING Of hTable To bJITBinding
If (bJITBinding) Begin
Get DriverIndex sDriver To iDriver
Get_Attribute DF_FILE_DATABASE_ID of hTable To hDatabase
Get_Attribute DF_DATABASE_JIT_TRESHOLD of iDriver hDatabase to iTreshold
Move (iTreshold * 1024 * 1024) To iTreshold
Move 0 To iNumJITColumns
Get_Attribute DF_FILE_NUMBER_FIELDS Of hTable To iNumColumns
For iColumn From 1 To iNumColumns
Get_Attribute DF_FIELD_NATIVE_SIZE Of hTable iColumn To iNativeLength
If (iNativeLength >= iTreshold) Begin
Get_Attribute DF_FIELD_NAME Of hTable iColumn To sColumn
If (iNumJITColumns = 0) ;
Showln "JIT Columns In table " sTable ":"
Showln " - " sColumn
Increment iNumJITColumns
End
Loop
If (iNumJITColumns = 0) ;
Showln "Table " sTable " does not have JIT Columns."
End
Else ;
Showln "JIT Binding off for " sTable "."
End
Else ;
Showln "Not a SQL Server table: " sTable
Get_Attribute DF_FILE_NEXT_USED of hTable To hTable
End
End_Procedure // ShowJITColumns
The sample procedure above shows all JIT columns of the SQL Server tables in the filelist. It does this by comparing the native size of columns to the JIT threshold. The database handle can be obtained via the DF_DATABASE_ID attribute.