Home page  
Help >
DdGetVarCharData() - special API for fetch callback to retrieve VARCHAR data
Version 7.11
DdGetVarCharData() - special API for fetch callback to retrieve VARCHAR data DdGetVarCharData() - special API for fetch callback to retrieve VARCHAR data

DdGetVarCharData() is a special API for the fetch callback to retrieve VARCHAR data.

Prototype:
   void DdGetVarCharData(
      WtHandle hControlHandle,      /* [IN] ctl->ddlHandle */
      WtChar8 *pszTableAliasName,   /* [IN] pszTableAliasName from Fetch Callback */
      WtChar8 *Buffer,              /* [IN] destBuff from Fetch Callback */
      WtInt32 lItemIndex,           /* [IN] 1-rel index of requested TBAPI_FETCHCB_INFO */
      WtChar8 *BufferOut,           /* [IN/OUT] user supplied buffer for VarChar data */
      WtInt32 *bufferOutSizeRef,    /* [IN] size of bufferOut */
                                    /* [OUT] actual number of bytes transferred */
                                    /* (including terminating null) */
      WtInt32 *piStatus);           /* [OUT] 0 or error code */
 

Description:
DdGetVarCharData() is a special API function than can be called only from the fetch callback. It retrieves data from a VARCHAR field and stores it in the caller-supplied buffer, BufferOut.

Calls to DdGetVarCharData() are instituted exclusively from the user's fetch callback function; and the call to DdGetVarCharData() 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.

Description of Parameter lControlHandle:
long lControlHandle is the member ctl->ddlHandle from the CONTROL{} structure for this process;

Description of Parameter pszTableAliasName:
WtChar8 *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:
WtChar8 *Buffer is the destBuff parameter from the fetch callback.

Description of Parameter lItemIndex:
WtInt32 lItemIndex is the 1-rel index of the TBAPI_FETCHCB_INFO{} structure for the requested VARCHAR field.

Description of Parameter BufferOut:
WtChar8 *BufferOut is a caller-supplied buffer where the requested VARCHAR field data is stored. The minimum size for this buffer is iDataLength + 1 from the TBAPI_FETCHCB_INFO{} structure.

The VARCHAR data is stored in this buffer with a terminating zero. No blanks are appended.

Description of Parameter bufferOutSizeRef:
WtInt32 *bufferOutSizeRef on entry is the size of BufferOut in bytes .

On exit, it is the size of the returned VARCHAR data including the terminating null.

Description of Parameter piStatus:
WtInt32 *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.