ChangeBatch Change current batch (group of records). Short Name CHGBAT() Type ISAM function Declaration COUNT ChangeBatch(COUNT batchnum) Description ChangeBatch() is called before each use of DoBatch() when multiple batches are in use at the same time. As a new batch area is needed, call ChangeBatch() with a unique batchnum. When ChangeBatch() perceives a previously unused batchnum value, AllocateBatch() is called to allocate the necessary batch structures for this new batchnum. These structures are not a concern of your program, but they are required for multiple, simultaneous batches. Changing between active batches is accomplished by passing the desired batchnum value. batchnum values do not need to be consecutive and can be positive or negative values up to the maximum value of COUNT. See your compiler’s limits.h file for the maximum value of a 2-byte integer. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example #define namebuf 32
TEXT name[namebuf]; /* customer name */ LONG num; /* customer number */ } parentimage;
PKEYREQ batsample; /* batch partial key request structure */ TEXT recbuf[1024]; /* batch retrieval structure */ TEXT worktarget[namebuf]; COUNT keyno;
cpybuf(worktarget,"John",strlen("John"));
batsample.siglen = strlen(worktarget); cpybuf(batsample.target,worktarget,strlen(worktarget));
DoBatch(keyno,&batsample,recbuf, 40,BAT_GET|BAT_RET_REC)) printf("\n\tError on BATSET - isam_err = %d",isam_err);
memset(worktarget,' ',namebuf); cpybuf(worktarget,"Fred",strlen("Fred"));
batsample.siglen = strlen(worktarget); cpybuf(batsample.target,worktarget,strlen(worktarget));
DoBatch(keyno,&batsample,recbuf, 40,BAT_GET|BAT_RET_REC)) printf("\n\tError on BATSET - isam_err = %d",isam_err);
DoBatch(keyno,NULL,NULL,0L,BAT_CAN);
DoBatch(keyno,NULL,NULL,0L,BAT_CAN); See also AllocateBatch(), FreeBatch(), DoBatch() |
||||||||||||