DbiGetDescs functions

<< Click to Display Table of Contents >>

Navigation:  Application development > Retrieving schema and system information >

DbiGetDescs functions

Previous pageReturn to chapter overviewNext page

Inquiry function structures are supplied by the application. These function calls return descriptive information.

List function

Record structure

DbiGetDatabaseDesc

DBDesc structure

DbiGetDriverDesc

DRVType structure

DbiGetFieldDescs

Array of FLDDesc structures

DbiGetFieldTypeDesc

FLDType structure

DbiGetIndexDesc

IDXDesc structure

DbiGetIndexDesc

Array of IDXDesc structures

DbiGetIndexTypeDesc

IDXType structure

DbiGetTableTypeDesc

TBLType structure

DbiQGetBaseDescs

STMTBaseDesc structure

 

Example

The following example shows how to retrieve all the index descriptors with one function call:

DBIResult   rslt;

hDBICur     hCursor;

CURProps    curProps;

pIDXDesc    pIdxArray;

// Open the table

rslt = DbiOpenTable(hDb, "Sample", szPARADOX, NULL, NULL, 0, dbiREADWRITE, dbiOPENSHARED, xltFIELD, TRUE, NULL, &hCursor);

if (rslt == DBIERR_NONE)

{

  // Get the properties for the cursor

  DbiGetCursorProps(hCursor, &curProps);

  // Allocate the buffer for the index descriptors

  pIdxArray = (pIDXDesc) malloc(sizeof(IDXDesc) * curProps.iIndexes);

  // Get the indexes

  rslt = DbiGetIndexDescs(hCursor, pIdxArray);

  if (rslt == DBIERR_NONE)

  {

    …

  }

  // Clean up

  free((pCHAR) pIdxArray);

  DbiCloseCursor(&hCursor);

}