I. The IDENTITY modifier
IDENTITY is a modifier to the .dbd data declaration key-word KEY.
It can be applied to any KEY declaration except for data types
LOGICAL, DATE, DATETIME and MEMO.
The IDENTITY modifier invokes the Auto Increment feature for the
instance of the key to which it is applied. It can be applied to
multiple instances of a key; in this case, the <seed>,<increment>
parameters, if specified, must be identical; however, there is no
enforcement of this requirement.
The syntax is:
IDENTITY [(<seed>,<increment>)]
<seed> - if source data type is X(), <seed> is a character string
enclosed in 's. The string must include contiguous digits ['0' - '9'],
but can optionally include a non-numeric prefix and/or suffix.
If the source data type is other than X(), <seed> is a non-negative
integral decimal number.
<increment> - is a non-negative integral decimal number;
Whenever a record is written to a table that contains one or more
Auto Increment fields, each of the Auto Increment fields is assigned
a unique value as determined by the field's associated key structure.
For global keys, the assigned value is unique with respect to all
keyed instances of the field; this applies to both token-mapped and
non-token-mapped fields; this also applies to cross data types and
to ATTACHed data bases.
The Auto Increment feature applies to the following TB APIs:
. ddlWrite()/ddlWriteEx()/ddlWriteV()
. ddlPutRec()
. ddlLoad()/ddlLoadMem()
. Calc Object WRITE
. ddlCopyData()
If a user attempts to create or modify an Auto Increment column, the user
specified value is ignored; but there is no warning or error message.
Beginning with TB API 8.0.155, if an IDENTITY field is included in the RD
of a ddlPutRec() API function, the generated value is returned to <Image>.
II. MODE AUTOINCR
AUTOINCR ON enables the Auto Increment feature for all keyed columns
that have the IDENTITY modifier in the .dbd definition.
AUTOINCR ON is the default.
AUTOINCR OFF disables the Auto Increment feature for all keyed columns
that have the IDENTITY modifier in the .dbd definition.
III. ddlInfo()
The ddlInfo() display includes the modifier "i" for keyed columns
that have the IDENTITY modifier in the .dbd definition.
IV. ddlVerify()
For SIGNATURE [<table-name>] <column-name> KEY, the value of
ctl.Ans3str[] includes "i" for keyed columns that have the
IDENTITY modifier.
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.