C Examples: DbiGetIndexDescs

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetIndexDescs

Return to chapter overview

Get the properties of all the indexes for the table open with the specified cursor

IndexDesc is allocated within the function. This example uses the following input:
         fDbiGetIndexDescs(hCur, &pIdxDesc);

DBIResult fDbiGetIndexDescs(hDBICur hTmpCur, pIDXDesc *IndexDesc)

{

   DBIResult   rslt;

   CURProps    CurProps;

   rslt = Chk(DbiGetCursorProps(hTmpCur, &CurProps));

   if (rslt != DBIERR_NONE)

      return rslt;

   *IndexDesc = (pIDXDesc)malloc(CurProps.iIndexes * sizeof(IDXDesc));

   if (IndexDesc == NULL)

     return DBIERR_NOMEMORY;

   rslt = Chk(DbiGetIndexDescs(hTmpCur, *IndexDesc));

   return rslt;

}