F.6 AddVRecord
Add a new variable-length data record, and its corresponding key values, to ISAM files.
SHORT NAME
ADDVREC
TYPE
ISAM function variable length record
DECLARATION
COUNT AddVRecord(COUNT datno, pVOID recptr, VRLEN varlen)DESCRIPTION
AddVRecord adds the data record with length in bytes given by varlen and pointed to by recptr to data file number datno. It automatically adds the key values defined for the data file to their respective index files. If successful, the new data record becomes the current ISAM record for datno. In multi-user applications, AddVRecord automatically causes a data record lock to be placed on the new record. Therefore, LockISAM(ctENABLE) and LockISAM(ctFREE) should be called before and after AddVRecord. However, if you are using transaction processing, (single-user and client/server models only), you will usually enable and free locks during the Begin and Commit functions.
RETURN
See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.
EXAMPLE
COUNT invfil;struct invd {LONG part_no;LONG on_hand;TEXT part_name[120];} recbuf;scanf("%ld %ld %119s",&recbuf.part_no,&recbuf.on_hand,recbuf.part_name);if (LockISAM(ctENABLE) || AddVRecord(invfil,&recbuf,8 +strlen(recbuf.part_name)) || LockISAM(ctFREE))printf("\nAddVRecord error %d in file %d",isam_err, isam_fil);SEE ALSO
The Chapter 5 "ISAM Functions" of the c-tree Plus Programmer's Reference Guide discusses how the relationship among the data files and their corresponding index files is specified.
|
FairCom Corporation www.faircom.com |