この関数は、基本的な取得操作を開始します。
構文
ESSG_FUNC_M EssGBeginRetrieve ( hGrid, ulOptions );
パラメータ | データ型 | 説明 |
---|---|---|
hGrid |
ESSG_HGRID_T |
EssGNewGridから戻されるハンドル。 |
ulOptions |
ESSG_ULONG_T |
取得タイプを示す定数。次のいずれかの値を使用する必要があります:
|
備考
オプションで、後で行がEssGSendRowsを介して渡されるときの更新のためにサーバーのブロックをロックします。
行を送信しなくても、メンバーとして使用される次元名のみでデフォルトのグリッドを取得できます。
戻り値
正常終了の場合は、ESSG_STS_NOERRが戻されます。
アクセス
なし。
例
#include <essapin.h> #include <essgapin.h> ESSG_VOID_T ESSG_BeginRetrieve(ESSG_HGRID_T hGrid) { ESSG_FUNC_M sts = ESS_STS_NOERR; ESSG_PPDATA_T pDataIn; ESSG_PPDATA_T ppDataOut; ESSG_RANGE_T rDataRangeIn, rDataRangeOut; ESSG_ULONG_T ulOptions; ESSG_USHORT_T usState; /* connect the grid to a database on the server */ sts = EssGConnect(hGrid, "Rainbow", "Admin", "Password", "Demo", "Basic", ESSG_CONNECT_NODIALOG); if(sts == 0) { ppDataIn = BuildTable(&rDataRangeIn); ulOptions = ESSG_RET_RETRIEVE; /* start the retrieve operation */ sts = EssGBeginRetrieve(hGrid, ulOptions); } if(sts == 0) { /* send the entire grid to define the query */ sts = EssGSendRows(hGrid, &rDataRangeIn, ppDataIn); } if(sts == 0) { /* perform the retrieval */ sts = EssGPerformOperation(hGrid, 0); /* free the built data */ FreeTwoDim(ppDataIn, rDataRangeIn.ulNumRows); } if(sts == 0) { /* determine the results of the retrieve */ sts = EssGGetResults(hGrid, 0, &rDataRangeOut, &usState); } if(!sts && usState == ESSG_STATE_DONE) { /* get all the data */ sts = EssGGetRows(hGrid, 0, &rDataRangeOut, &rDataRangeOut, &ppDataOut); } if(sts == 0) { DisplayOutput (ppDataOut, rDataRangeOut); /* free the returned data */ EssGFreeRows(hGrid, &rDataRangeOut, ppDataOut); } if(!sts) { EssGEndOperation(hGrid, 0); EssGDisconnect(hGrid, 0); } }
関連トピック