Skip to content

DF_DATABASE_TYPE_ID

The type identifier.

Level

Database

Supported by

The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.

Type

Enumeration List (Integer), temporary.

Access

Read Only.

Values

  • SQL_UNKNOWN_TYPE
  • SQL_CHAR
  • SQL_NUMERIC
  • SQL_DECIMAL
  • SQL_INTEGER
  • SQL_SMALLINT
  • SQL_FLOAT
  • SQL_REAL
  • SQL_DOUBLE
  • SQL_DATETIME
  • SQL_VARCHAR
  • SQL_TYPE_DATE
  • SQL_TYPE_TIME
  • SQL_TYPE_TIMESTAMP
  • SQL_DATE
  • SQL_INTERVAL
  • SQL_TIME
  • SQL_TIMESTAMP
  • SQL_LONGVARCHAR
  • SQL_BINARY
  • SQL_VARBINARY
  • SQL_LONGVARBINARY
  • SQL_BIGINT
  • SQL_TINYINT
  • SQL_BIT
  • SQL_WCHAR
  • SQL_WVARCHAR
  • SQL_WLONGVARCHAR
  • SQL_GUID

Syntax

Use cli.pkg
Get_Attribute DF_DATABASE_TYPE_ID of {driverNumber} {databaseHandle} {typeNumber} to {IntegerVariable}

Driver Configuration Keyword

None.

Remarks

This attribute returns the ID of the type. The type is identified by the handle to the database and the type's ordinal number.

The sample code below shows type attributes of all types in a database.

Procedure ShowTypes Integer iDriver Handle hDatabase
    Integer iNumTypes
    Integer iType
    String sTypeName
    Handle hTypeID
    Boolean bAutoinc
    Boolean bUnsigned
    Integer iMaxSize
    String sCreateParams

    Get_Attribute DF_DATABASE_NUMBER_TYPES of iDriver hDatabase to iNumTypes
    For iType from 0 to (iNumTypes - 1)
        Get_Attribute DF_DATABASE_TYPE_NAME of iDriver hDatabase iType to sTypeName
        Get_Attribute DF_DATABASE_TYPE_ID of iDriver hDatabase iType to hTypeID
        Get_Attribute DF_DATABASE_TYPE_AUTOINC of iDriver hDatabase iType to bAutoinc
        Get_Attribute DF_DATABASE_TYPE_UNSIGNED of iDriver hDatabase iType to bUnsigned
        Get_Attribute DF_DATABASE_TYPE_MAXSIZE of iDriver hDatabase iType to iMaxSize
        Get_Attribute DF_DATABASE_TYPE_CREATE_PARAMS of iDriver hDatabase iType to sCreateParams
        Showln " " iType ", " sTypeName ", " hTypeID ", " (If(bAutoinc, "Auto Increment", "NO Auto Increment")) ", " ;
            (If(bUnsigned, "Unsigned", "Signed")) ", " iMaxSize ", " sCreateParams
    Loop
End_Procedure

The database handle can be obtained via the DF_DATABASE_ID attribute.