f2s_column_autoinc_state¶
WAIT TILL THEY FIX THE DRIVER
Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers
Syntax
set_attribute f2s_column_autoinc_state of {FileNumber} {FieldNumber} to {variable}
get_attribute f2s_column_autoinc_state of {FileNumber} {FieldNumber} to {variable}
Parameter |
Description |
---|---|
FileNumber |
Number of the file (filename.File_Number) |
FieldNumber |
Number of the field |
variable |
Boolean variable. If true, this field auto increments. If false, it does not. |
Description
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.
Examples
get_attribute
Integer iField iFields
String sField
boolean bCreated
//use the dataflex attribute to the get the total number of fields
Get_Attribute DF_FILE_NUMBER_FIELDS of newcust.File_Number to iFields
//loop through the fields to see which ones are auto-increment
For iField from 0 to iFields
Get_Attribute f2s_column_autoinc_state of newcust.File_Number iField to bCreated
Get_Attribute DF_FIELD_NAME of newcust.File_Number iField to sField
If (bCreated) Showln "Field " sField " is a autoincrement field"
Else Showln "Field " sField " is NOT a autoincrement field"
Loop
set_attribute
<EXAMPLE>
Related Attributes
reference
reference 2
ESQL Equivalents
Replaces: DF_FIELD_AUTO_INCREMENT