Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbGetIndexStatus

Retrieves the status of the index handle.

DECLARATION

ULONG ctdbGetIndexStatus(CTHANDLE Handle);

DESCRIPTION

Retrieves the status of the index handle. Handle is a FairCom DB API index handle.The status of the index handle is a bit map describing one or more changes that have occurred to the index object.

RETURN

ctdbGetIndexStatus() returns a bitmap of the following::

Value

Symbolic Constant

Explanation

0x00

CTDBINDEX_OLD

Original value (no changes)

0x01

CTDBINDEX_NEW

Index added

0x02

CTDBINDEX_DEL

Original Index deleted

0x04

CTDBINDEX_KEYTYPE

Index key type changed

0x10

CTDBINDEX_EMPCHAR

Index empty char changed

0x20

CTDBINDEX_DUPFLAG

Index duplicate flag changed

0x40

CTDBINDEX_NULLFLAG

Index null flag changed

0x80

CTDBINDEX_AIDXNAM

Index file name changed

See Appendix A for a complete listing of valid c-tree Plus error values.

EXAMPLE

/* if the index has been changed, call alter table */

CTHANDLE hIndex = ctdbGetIndex(hTable, 0);


if (ctdbGetIndexStatus(hIndex) != CTDBINDEX_OLD)

if (ctdbAlterTable(hTable, CTDB_ALTER_NORMAL) != CTDBRET_OK)

printf("ctdbAlterTable failed\n");

SEE ALSO

ctdbGetFieldStatus(), ctdbGetSegmentStatus()

TOCIndex