Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctAddSerialNumberField

Declaration

ctCONV NINT ctDECL ctAddSerialNumberField(FILNO datno, UCOUNT mode, UCOUNT offset, UCOUNT length);

  • datno is the user file number of the data file, which must be open in exclusive mode.
  • mode is either SRLSEG or SCHSRL.
  • offset is the serial number offset, which is interpreted as follows: If mode is SCHSEG, offset is a zero-based offset in the record, otherwise offset is the zero-based field number in the DODA.
  • length is the size of the serial number in bytes, either 4 or 8.

NOTE: The data file requires an extended header in order to use this function.

Description

ctAddSerialNumberField() modifies any four- or eight-byte integer field to be automatically incremented when a record is inserted. Unlike an SRLSEG or SCHSRL field, the field is not indexed.

This function returns a c-tree error code. NO_ERROR indicates success.

NOTE: If a version of the database engine that doesn't support this feature attempts to open a data file that uses this feature, the file open fails with error 744 (FREL_ERR) and logs a message to CTSTATUS.FCS indicating which feature bit is not supported. In that case, the solution is to update the database engine to a version that supports this feature.

See Also

Serial Segments (SRLSEG)

Sequence Number Segments

Serial Number Segments

Key Segment Modes (Key Segment Modes, /doc/ctreeplus/30863.htm)

TOCIndex