Sample Code
/* sample code to return LONGVARBINARY data from the Driver */
DataChainList *pDataChainList;
*piXODataType = XO_TYPE_LONGVARBINARY;
/* create the data chain list */
if (!(pDataChainList = sqlu_createDataChain(pStmtData->pMemTree))) {
return OADS_ERROR;
}
/* add all the data blocks */
while (TRUE) {
void *pData;
if (!(pData = (void *)xm_allocItem(
pStmtData->pMemTree,
iColDataLen,
XM_NOFLAGS))) {
return OADS_ERROR;
}
/* copy the data block */
memcpy(pData, pColDataBuff, iColDataLen);
/* add data block to DataChainList */
if (!sqlu_addToDataChain(pStmtData->pMemTree, pDataChainList,
(void *) pData,iColDataLen)) {
return OADS_ERROR;
}
/* check if more data exists */
if (more data) {
/* get the rest of the data blocks */
---- Driver specific code ------ }
else {
break;
}
}
/* set the return parameters */
*ppValAsStr = (void *) pDataChainList;
*plValAsStrLen = pDataChainList->iTotalDataLen;