tColumnType - The Database Update Framework
See Also: Declaring Variables, Struct
Purpose
tColumnType is a structured type used for some members of the cDbUpdateFunctionLibrary class. Column types can be enumerated with the UtilEnumerateColumnTypes function and passing the iDbType and driver ID. The return value is a struct array with all allowed data types for the iDbType and driver ID combination.
Type Declaration
Struct tColumnType
String sType
Integer iType
String sPrecision
Boolean bFixedSize
String sDFType
Integer iDFType
End_Struct
Struct Members
sType
The database column type as a text string. E.g. "bigint", "char", "varchar", "float" depending on the current psDriverID and piDbType setting. This value will be used when e.g. new columns are to be added with the SqlColumnAdd function.
iType
A constant integer representing the database column type. E.g. DF_ASCII_DUF, SQL_CHAR, SQL_VARCHAR, SQL_FLOAT et al. These constants are defined in these packages; CLI.pkg, MSSQLDRV.pkg, DB2_DRV.pkg, ODBC_DRV.pkg or Mertech.inc. There are different constant integers to be used for each database back-end. Please see the Mapping of SQL Data Types chapter tables.
sPrecision
A string with the max allowed size for the database column type. E.g. "14.0" for "bigint", "8000" for "char" or "14.8" for "float".
bFixedSize
A boolean that if True denotes that the sPrecision is fixed and cannot be changed.
sDFType
The corresponding DataFlex data type. One of; "ASCII", "Numeric", "Date", "Text", "Binary" or "DateTime"
iDFType
A constant integer representing the DataFlex column type. One of; DF_ASCII_DUF, DF_BCD_DUF, DF_DATE_DUF, DF_TEXT_DUF, DF_BINARY_DUF or DF_DATETIME_DUF.
Syntax
Use cDbUpdateFunctionLibrary.pkg
:
tColumnType {variableName}
Declaring variables
To declare tColumnType variables, use the name of the type (tColumnType) followed by the variable name.
tColumnTypeArray[] ColumnTypeArray
See struct variables for more details of instantiating struct types.