D_KEYEXIST

SUMMARY
d_keyexist(FIELD[,dbn])
long FIELD;
int dbn;

ARGUMENTS
FIELD The field type of the optional key field the existence of which
is to be checked.

dbn (optional) The number of the database containing the record.

DESCRIPTION
This function determines if the key for optional key FIELD in the current
record has been stored.Status S_OKAY is returned if the key has been stored.
Status S_NOTFOUND is returned if the key has not been stored.
This function reads the optional key bit from the record header stored in
the data file. Thus ,in shared access mode,the data file must be locked.

CURRENCY CHANGES
None.

RETURN CODES

0 S_OKAY optional key value has been stored.

2 S_NOTFOUND Optional key value not stored.

-5 S_INVFLD Invalid field type.

-24 S_NOTLOCKED Data file containing current record is not locked.

-37 S_NOTOPTKEY Specified field type is not defined as an optional key.

-38 S_BADFIELD Specified field type not defined in current record.


EXAMPLE

if (d_keyexist(EMP_ID)==S_NOTFOUND)
{
/* store employee id */
d_keystore(EMP_ID);
}