FLDDesc (field descriptor)

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

FLDDesc (field descriptor)

Return to chapter overview
hmtoggle_plus1See also

The FLDDesc structure defines a field in a table, using the properties in the following table:

Note:The same descriptor structure is used both in creating a table and in inquiring about the table structure after it is opened. The application developer does not specify the last five properties in the field descriptor structure when a table is created.

Field

Type

Description

iFldNum

UINT16

On input, specifies the field number. This value can be from 1 to curProps.iFields. On output, this is the invariant field ID. Note: Do not use this value as a field number.

szName

DBINAME

Specifies the name of the field. Note: ADT field names do not include the parent names. For exampe, ‘ID.BIRTHDAY.NAME’ will be “NAME’. Use DbiGetProp() with curFULLFIELDNAME to obtain the full name of an ADT field.

iFldType

UINT16

Specifies the type of the field. In output mode, if translate mode is set to xltNONE, field types represent the physical types of that driver type, otherwise, the types are BDE logical types.

iSubType

UINT16

Specifies the subtype of the field. This could be a BDE logical subtype or a driver physical subtype depending on the translate mode setting.

iUnits1

INT16

Specifies the number of characters, digits, and so on. The interpretation of this field can be dependent on the driver and also on the specific field type. For most drivers, if the field is of the numeric type, iUnits1 is the precision and iUnits2 is the scale.

iUnits2

INT16

Specifies the number of decimal places, and so on. The interpretation of this field can depend on the driver and also on the specific field type. For most drivers, if the field is of the numeric type, iUnits1 is the precision and iUnits2 is the scale.

iOffset

UINT16

Reports the offset of this field in the record buffer. This offset depends on the translation mode; it could be the offset in the physical or logical representation of the record. This field applies only to existing tables; it is not applicable when a table is created.

iLen

UINT16

Reports the length in bytes of this field. The length depends on the translation mode; that is, it could be the length of the logical or physical representation of the field. The application developer uses this value to allocate a buffer in which to retrieve the field value. This field applies only to existing tables; it is not applicable when a table is created.

iNullOffset

UINT16

Reports the offset of the NULL indicator for this field in the record buffer. If zero, there is no NULL indicator. Otherwise, iNullOffset is the offset to an INT16 value, which is -1 if the field is NULL. This field applies only to existing tables; it is not specified when a table is created.

efldvVchk

FLDVchk

Reports the types of validity checks associated with this field (this field applies only to existing tables; it is not specified when a table is created). The following validity check types can be reported: fldvNOCHECKS, fldvHASCHECKS, or fldvUNKOWN.

efldrRights

FLDRights

Reports the field level rights for this user (this field applies only to existing tables; it is not specified when a table is created). Field rights can be one of the following values: fldrREADWRITE, fldrREADONLY, fldrNONE, or fldrUNKOWN.

bCalcField

BOOL16

TRUE, if field is a calculated field (computed).

iUnUsed3

UINT16

Reserved for future use

The FLDDesc structure is used in a wide variety of contexts:

The DbiCreateTable function uses a CRTblDesc table descriptor structure which is an array of FLDDesc structures. A similar array of FLDDesc structures is used when creating in-memory tables using the DbiCreateInMemTable function and creating temporary tables with DbiCreateTempTable function.

The DbiDoRestructure function uses FLDDesc structures through its pTblDesc parameter.

The DbiGetFieldDescs uses an array of FLDDesc structures when retrieving field descriptions of a table.

The DbiOpenFieldList. function uses FLDDesc structures when retrieving field information from closed tables.

A FLDDesc structure is peripherally in the process of batch moving data between tables using the DbiBatchMove function when evaluating the compatibility between source and destination fields.