ufldlst

Describes the fields in a table.

Description

An array of ufldlst structures (informally called the field list) is used to describe the table and all the fields in the table. The first structure in the array provides information about the table itself, every following structure describes a field.

Unless stated otherwise, every field is set by Uniface before the connector is called. With the exception of uflen, all fields in the ufldlst structures hold the same value in every connector request for a particular table.

Structure of a Field List

Graphical content.

The connector can access the field list by using the address of the first element provided in the current uctrl structure. The information about the entity is available in control_block->uflist[0], where control_block contains the address of the current uctrl structure. This entry of the field list is reserved for use by Uniface.

The fields are described in:

control_block->uflist[1]...

control_block->uflist[(control_block->ufnum -1)]

where the array indexes 1...(control_block->ufnum -1) are by definition the ‘field numbers’. Other data structures use field numbers to refer to the field list.

The control_block->uflist[(control_block->ufnum -1)] entry describes the field containing the variable part of the record, if the record has a variable part.

Note:  There is no explicit link between the pointer and the data fields of a segmented field. The connector must therefore compare the field names. The pointer field has a field number less than (uctrl->ufnum - 1) and a name starting with ‘S_’ followed by the name of the data field. The data field has a field number greater than or equal to (uctrl->ufnum - 1).

Members

ufldlst Members
Member Description
short ucsfmt Original connector-level packing code for the field, before redefinition.
short udbfmt Redefined connector-level packing code for the field. See also the description of uinfo->upfmt[] in the structure.
unsigned char ufbits Array of Boolean flags describing some properties of the field. A property applies only if the bitwise AND of the corresponding mask and the value of ufbits is nonzero. Mask values and their meanings are described in the table below
unsigned char ufix Describes the nature of a field:
  • 0 Variable-length field in the variable part of the record
  • 1 Fixed-length field in the variable part of the record
  • 2 Field in the fixed part of the record
long uflen Actual length of the field value in the general I/O buffer. Uniface sets this value before a Write or Update call to the connector. The connector must set this value for every fetched field when a record (or part of a record) has been fetched from the database in the Select or Fetch connector request.

The value zero means that the field contains the NULL value (missing value symbol).

Uniface does not distinguish between the empty field (the value is present, but its length is zero) and the NULL value (the value is missing) for fields with connector-level packing codes pC, pR and pU. When such a field allows the NULL value (see mask 64 of field ufldlst->ufbits), a length of zero must be interpreted as the NULL value. Otherwise it must be interpreted as an empty field.

long ufmax Maximum size of the field value.
short ufname Offset to the null-terminated field or entity name in the field names string (uctrl->ufstring).
short ufpos Offset to the start position of the field in the general I/O buffer.
unsigned char ufscal Numeric data scaling specification. The number represents the number of decimal positions after the decimal point. Zero means there is no scaling.

This is only meaningful with Numeric packing codes.

Using the ufscal field is optional. Uniface automatically handles any scaling defined for a field in the application model. By specifying the scaling as part of the table definition when the table is created in the DBMS, the contents of the DBMS data dictionary will more closely reflect the contents of the Uniface Application Objects Repository.

unsigned char uindex Number of the first index to which the field belongs:
  • 1—The field is part of the primary key.
  • 0—The field is not part of an index.
ufbits Masks
Mask Meaning
1 Obsolete.
4 The field must be stored as a variable-length field in the database, if the DBMS supports variable-length fields. If a field is of variable length (ufldlst->ufbits mask value 4), Uniface does not pad values for the field with spaces.
8 The field is either the pointer or the data field of a segmented field.
16 Reserved for internal use.
32 The field (in the variable part of the record) contains Raw data.
64 Mandatory field. NULL value (missing value) is not allowed.
128 If the field has a connector-level packing code in pN1-pN32, Uniface uses leading spaces instead of zeros.
256 and higher Reserved for internal use.