DF_FILE_JIT_BINDING
Indicates whether JIT binding is on for large columns in the table.
Level
Table
Supported by
The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.
Type
Boolean, permanent
Access
Read / Write
Values
- True
- False
Syntax
Use cli.pkg
Get_Attribute DF_FILE_JIT_BINDING of {tableNumber} to {BooleanVariable}
Set_Attribute DF_FILE_JIT_BINDING of {tableNumber} to {True|False}
Remarks
This attribute indicates whether JIT binding is on for large columns in the table. JIT binding is a technique that retrieves the value of a large column only when requested by the application and moves it to a program variable, for example. Only columns that are larger than the JIT threshold are eligible for JIT binding. If the DF_FILE_JIT_BINDING attribute is true, the JIT binding process will be applied to all eligible columns in the table.
This attribute can only be set inside a Structure_Start ... Structure_End operation.
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 file list.