DeleteVRecord Delete current variable length ISAM record. Short Name DELVREC() Type ISAM variable length record function Declaration COUNT DeleteVRecord(COUNT datno) Description DeleteVRecord() deletes the current variable-length ISAM record for data file datno. If the data record is successfully deleted, DeleteVRecord() updates all associated index files and returns the data record to the pool of available records for data file datno. After the deletion, the current ISAM record information stays unchanged! That is, even though the current record has just been deleted, the information in the current ISAM buffer is not disturbed so that you can scan in either direction through the data via the NextRecord() or PreviousRecord() routines. If key values reside in the variable-length portion of the record, the entire record must be retrieved, usually with ReReadVRecord(). In multi-user systems, invoke LockISAM(ctENABLE) before the ISAM routine which reads the record to be deleted. Delete frees low-level locks, but LockISAM(ctFREE) should be called after DeleteVRecord() to clear the LockISAM() state. See the example below. DeleteVRecord() does not shrink the files. c-tree Plus tracks and reuses deleted space before expanding the files. To remove all deleted space, compact the file using CompactIFile() or the compact utility, ctcmpc. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example COUNT invfil, part_no_idx; LONG part_key, plen;
LONG part_no; TEXT part_name[120]; } recbuf;
scanf("%ld",&part_key);
printf("\nError enabling locks = %d",isam_err);
else if GetVRecord(part_no_idx, &part_key, &recbuf, plen) printf("\nError on GetRecord = %d",isam_err);
else if DeleteVRecord(invfil)) printf("\nCould not delete PART #%ld (%d %d).",
part_key, isam_err, isam_fil); } LockISAM(ctFREE); See also DeleteRecord(), NextRecord(), PreviousRecord(), ReReadVRecord(), LockISAM(), |
|||||||||||||||||||||