Home page  
Help >
DdGetFetchInfo() - special API for fetch callback batch mode
Version 7.11
DdGetFetchInfo() - special API for fetch callback batch mode

DdGetFetchInfo() is a special API for the fetch callback batch mode.

Prototype:
    void
      DdGetFetchInfo( WtHandle       lControlHandle, /* [IN]ctl->ddlHandle */
      WtChar8 *pszTableAliasName,    /* [IN] table or alias name */
      WtChar8 *Buffer,               /* return is in form of TBAPI_GETFETCHINFO_HEADER{} */
      WtInt32 lBufferSize,
      WtInt32 *piStatus)
 
   From ddl_defs.h:
 
   typedef struct TBAPI_GETFETCHINFO_HEADER{
      WtInt32 iStructureLength;     /* total length of this structure in bytes */
      WtInt32 iItemCount;           /* number of TBAPI_GETFETCHINFO_ITEM{} members */
      WtInt32 iOffsetToItem;        /* offset to first TBAPI_GETFETCHINFO_ITEM{} */
   }TBAPI_GETFETCHINFO_HEADER;
    
   typedef struct TBAPI_GETFETCHINFO_ITEM{
      WtInt32 lRecordNumber;
      WtInt32 lDataOffset;
      WtInt32 iRecordInstanceCount;
   }TBAPI_GETFETCHINFO_ITEM;

Description:
DdGetFetchInfo() is a special API function than can be called only from the fetch callback.

Results are returned in Buffer recast as TBAPI_GETFETCHINFO_HEADER*; refer to the following comments for a more detailed description of the format of Buffer.

Calls to DdGetFetchInfo() are instituted exclusively from the user's fetch callback function; and the call to DdGetFetchInfo() for a specific table can only be made from the fetch callback for that specific table.

The fetch callback for a specific table is triggered by TBAPI only when a table contains virtual data that is being requested by the underlying TBAPI function.

The description of collection processing modes gives insight that may be helpful in defining and testing a batching algorithm.
Description of Parameter lControlHandle:
long lControlHandle is the memberctl->ddlHandle from the CONTROL{} structure for this process;

Description of Parameter pszTableAliasName:
char *pszTableName is the null-terminated acsii (internal) table name of the target table [if it is not an alias]; otherwise, it is the null-terminated ascii table alias name;

Description of Parameter Buffer:
char *Buffer is an empty buffer supplied by the caller; its size is specified by the parameter lBufferSize; the format of Buffer is:
      TBAPI_GETFETCHINFO_HEADER
      TBAPI_GETFETCHINFO_ITEM #1
      TBAPI_GETFETCHINFO_ITEM #2
      ...
      TBAPI_GETFETCHINFO_ITEM #N
      DataItem #1
      DataItem #2
      ...
      DataItem #N
 
   TBAPI_GETFETCHINFO_HEADER *header = 
    0;  TBAPI_GETFETCHINFO_ITEM
 
   *item=   0; header->iItemCount is the number
   ofitems being returned; header->iOffsetToItem is Buffer-0 relative offset to
 
   thefirst item; item->lRecordNumber is the 1-relative
   recordnumber; item->lDataOffset is the Buffer-0 relative offset to the
   data;item->iRecordInstanceCount is the number of times item->lRecordNumber
      occured in this buffer;

Description of Parameter lBufferSize:
long lBufferSize is the size (in bytes) of Buffer; the required size calculation for Buffer is:
      sizeof(TBAPI_GETFETCHINFO_HEADER) + N * [sizeof(TBAPI_GETFETCHINFO_ITEM) + DataSize]
where N is the maximum number of items to be returned and DataSize is the size of the virtual record;

Description of Parameter piStatus:
int *piStatus is 0 or a status code that indicates an error;

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.