DF_FIELD_AUTO_INCREMENT

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

Auto incrementing is a technique used in Dataflex usually for fields that are set as the unique identifier. Instead of generating a value or manually inserting data into the column, when a field auto increments, the value of the field increases by one (usually) with each record. This field is used to get or set whether the field uses this technique or not. The attribute, however, can only be set inside of a Structure_Start or during table creation. Getting the attribute’s value can be done at anytime. The value is stored as a boolean, either true or false.

Syntax

Set_Attribute DF_FIELD_AUTO_INCREMENT of {FileNumber} {FieldNumber} to {variable}
Get_Attribute DF_FIELD_AUTO_INCREMENT of {FileNumber} {FieldNumber} to {variable}

Parameter

Description

FileNumber

Number of the file

FieldNumber

Number of the field

variable

Boolean variable indicating if the field auto increments.

Example

open Customer

Integer iColumn
Boolean bIncrement
Handle hFile

Move Customer.File_Number to hFile

Structure_Start hFile "ORA_DRV"
    Set_Attribute DF_FIELD_AUTO_INCREMENT of hFile iColumn to True
    Get_Attribute DF_FIELD_AUTO_INCREMENT of hFile iColumn to bIncrement
Structure_End hFile DF_STRUCTEND_OPT_NONE "." 0