DbiOpenIndexList

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiOpenIndexList

Return to chapter overview

C syntax

DBIResult DBIFN DbiOpenIndexList (hDb, pszTableName, [pszDriverType], phCur);

Delphi syntax

function DbiOpenIndexList (hDb: hDBIDb; pszTableName: PChar; pszDriverType: PChar; var hCur: hDBICur): DBIResult stdcall;

Description

DbiOpenIndexList opens a cursor on a table listing the indexes on a specified table, along with their descriptions.

Parameters

hDb                Type: hDBIDb                (Input)
Specifies the database handle.

pszTableName                Type: pCHAR                (Input)
Pointer to the table name for which indexes are to be listed. For Paradox, FoxPro, and dBASE, if pszTableName is a fully qualified name of a table, the pszDriverType parameter need not be specified. If the path is not included, the path name is taken from the current directory of the database associated with hDb.

For SQL databases, this parameter can be a fully qualified name that includes the owner name.

pszDriverType                Type: pCHAR                (Input)
Pointer to the driver type. Optional. For Paradox, FoxPro, and dBASE tables, this parameter is required if pszTableName has no extension. This parameter is ignored if the database associated with hDb is a SQL database. pszTableType can be one of the following values: szDBASE, szMSACCESS, or szPARADOX.

phCur                Type: phDBICur                (Output)
Pointer to the cursor handle.

Usage

If there are no indexes, a cursor to an empty table is returned.

Oracle:                For performance reasons, bPrimary is not set in the FLDDesc structure.  To determine if a primary index exists on a table, use DbiSetProp  with the curGETEXTENDEDINFO property before calling DbiGetIndexDescs.

Completion state

Each of the index description records can be retrieved using DbiGetNextRecord. DbiGetCursorProps can be used to allocate the proper record size. After the record is retrieved, it can be cast with the IDXDesc type definition, and used like an IDXDesc C language structure. This function retrieves index information from a closed table, as opposed to DbiGetIndexDescs and DbiGetIndexDesc that use an open table.

DbiResult

Meaning

DBIERR_NONE

The table listing indexes for the table has been created.

DBIERR_INVALIDHNDL

The specified database handle is invalid or NULL, or phCur is NULL.

DBIERR_INVALIDPARAM

The specified table name or the pointer to the table name is NULL.

DBIERR_NOSUCHTABLE

The specified table name is invalid.

DBIERR_UNKNOWNTBLTYPE

The specified driver type is invalid.

See also

DbiGetNextRecord, DbiGetCursorProps, DbiGetIndexDesc, DbiGetIndexDescs