mco_index_stat_num

Return the number of indexes in the database.

Prototype

    MCO_RET mco_index_stat_num( /*IN*/ mco_trans_h t,
                                /*IN*/ uint2 * n_indexes);

Arguments

t
The mco_trans_h transaction handle returned by mco_trans_start().
n_indexes
Address of a 2-byte unsigned integer representing the total number of indexes in the database.

Description

This function returns the number of indexes in the database.

Return Codes

MCO_S_OK
The number of indexes was returned successfully.

Example

    Application snippet:

    const char * dbname = "SimpleDb";

    int main(int argc, char* argv[])
    {
        mco_db_h db;
        MCO_RET rc;
        mco_device_t dev;
        mco_db_params_t db_params;
        mco_trans_h t;
        uint2 n_indexes;

        ...
        rc = mco_db_open_dev(dbname, simple_get_dictionary(), &dev, 1, &db_params);
        if (MCO_S_OK != rc)
        {
            rc = mco_db_connect(dbname, &db);
            ...
            rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
            if (MCO_S_OK == rc)
            {
                rc = mco_index_stat_num(t, &n_indexes);

                ...
            }

        ...
        }
    }

Files

Header file:
mco.h
Source file:
mcodb.c
Library:
libmcolib.a