Truksta puslapio .Kreiptis pas Ricka (73 74 32)



The record or set types specified with a keep lock must be locked in order
to apply a keep lock; otherwise,status S_NOTLOCKED is returned.

Within a transaction, a read-locked file can be upgrated to a write or
exclusive lock without the possibility of outside intervention by calling
d_lock with a write or exclusive lock where a read lock already exists.
If the upgrade lock request is denied, the lock will remain in effect.

If any of the requested lock




















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);
}