D_KEYFREE

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

ARGUMENTS
FIELD The field number of the key field to be freed.

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

DESCRIPTION
Function d_keyfree frees the read or exclusively locked key file which
contains occurrences of key field FIELD.This function can only be
executed outside of atransaction.Incide transaction,lock are freed by
functions d_trend or d_trabort.If the key type is exclusively locked,all
changed database pages in the cache are flushed.


CURRENCY CHANGES
None.

RETURN CODES

-5 S_INVFLD Invalid field type.

-17 S_NOTKEY FIELD is not a key.

-24 S_NOTLOCKED Key type is not locked.

-29 S_TRFREE Attempt to free aread lock inside a
transaction.

EXAMPLE

int count,stat=S_OKAY;
...
/*list info record in id_code order*/
while (stat == S_OKAY){
d_keylock(ID_CODE,"r");
for(count=0;count<20 &&
(stat=d_keynext(ID_CODE))==S_OKAY;++count){
/*hold lock for only 20 record at a time */
if(d_recread(&irec)==S_OKAY)pr_info();
}
d_keyfree(ID_CODE);
}