DF_FIELD_NATIVE_SIZE
The native size of a column on the back end.
Level
Column
Supported by
The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.
Type
Integer, permanent.
Access
Read Only.
Values
1..
Syntax
Use cli.pkg
Get_Attribute DF_FIELD_NATIVE_SIZE of {tableNumber} {columnNumber} to {IntegerVariable}
Remarks
This attribute returns the size of a column on the back end. The DF_FIELD_NATIVE_LENGTH attribute returns the size in the record buffer.
Example
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
End
Else ;
Showln "JIT Binding off for " sTable "."
End
End
Else ;
Showln "Not a SQL Server table: " sTable
End
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.