Skip to content

DF_FIELD_NATIVE_LENGTH

See Also: Get_Attribute, Set_Attribute

The length of a column in the record buffer.

Level

Column

Supported by

All Drivers

Type

Integer, permanent

Access

Read Only

Values

  • 1 (minimum)
  • max field size (maximum)

Remarks

The native length is the length, in bytes, a column takes up in the record buffer allocated by the driver for the table.

For all drivers, this is a permanent attribute that cannot be directly set. It can be set indirectly by setting the DF_FIELD_LENGTH and/or DF_FIELD_PRECISION attributes.

Function BufferSize Handle hTable Returns Integer
    Integer iNumColumns
    Integer iNativeLength
    Integer iBufferSize
    Integer iColumn

    Get_Attribute DF_FILE_NUMBER_FIELDS Of hTable To iNumColumns
    For iColumn From 1 To iNumColumns
        Get_Attribute DF_FIELD_NATIVE_LENGTH Of hTable iColumn To iNativeLength
        Move (iBufferSize + iNativeLength) To iBufferSize
    Loop

    Function_Return iBufferSize
End_Function // BufferSize

This example calculates the buffer size using the native length of all columns in the table.