Partager via


SET AUTOINCERROR Command

Specifies whether attempts to update or insert values in a field with automatically incrementing values generate errors.

Note   A cursor inherits the current setting of SET AUTOINCERROR when opened. Changing the value of SET AUTOINCERROR during a session does not change the setting for any cursors already opened. To change the setting of an open cursor, use the CURSORSETPROP( ) function.

SET AUTOINCERROR ON | OFF

Parameters

  • ON
    Generates an error when updating or inserting a value in a field that uses automatically incrementing field values. The ON setting is the default for a global or private data sessions.
  • OFF
    Does not generate an error when updating or inserting a value in a field that uses automatically incrementing field values and disregards the value specified for the field, which uses the appropriate incremented value.

Remarks

The OFF setting provides greater utility when using tables that contain autoincrementing fields with certain language operations such as the APPENDFROM and INSERT INTO commands where you need to otherwise specify a fields list and omit those fields that use autoincrementing from the operation.

SET AUTOINCERROR is scoped to the data session.

See Also

Commands | Autoincrementing Field Values in Tables