f2s_column_autonumber_state¶
Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers
Syntax¶
**There is no set_attribute. This attribute is read only.**
get_attribute f2s_column_autonumber_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¶
If a field is an identity column or if the field has a sequence assigned to it, this attribute will return true. In both of these cases, the field autoincrements when a new row is added.
Note
This attribute does not work properly for recnum fields. For example, using the Order Entry table from the DataFlex example:
get_attribute f2s_column_autonumber_state of inventory.FileNumber 0 to bIsAuto
bIsAuto will be 0.
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 auto-increment
For iField from 0 to iFields
Get_Attribute f2s_column_autonumber_state of newcust.File_Number iField to bCreated
Get_Attribute DF_FIELD_NAME of newcust.File_Number iField to sField
If (bCreated) Showln (sFormat("Field %1 auto-increments", sField))
Else Showln (sFormat("Field %1 does not uto-increment", sField))
Loop