mco_fh_mod_add_table

Adds a database table to the module’s list of tables.

Prototype

    mco_fh_ret mco_fh_mod_add_table(/*IN*/ mco_fh_module_h h,
                                    /*IN*/ const char *rec_type,
                                    /*IN*/ const char *name,
                                    /*IN*/ const char **fields,
                                    /*IN*/ mco_size_t nfields)

Arguments

h
The module handle.
rec_type
The type of the records for this table.
name
The name of the table.
fields
The array of field names to write.
nfields
The number of elements in the fields array.

Description

This function instructs the module to use the database table as specified. The module uses this information to determine which tables and fields to write.

Return Codes

MCO_FH_OK
Table successfully added.
MCO_FH_E_INVALID_RECORD_TYPE
The record type parameter is invalid.
MCO_FH_E_BAD_HANDLE
The module handle is invalid.

Example

    mco_fh_ret mco_fh_mod_add_table(mco_fh_module_h h, const char *rec_type,
                                    const char *name, const char **fields, mco_size_t nfields)
    {
        return reinterpret_cast<TestFeedHandler *>(h)->addTable(rec_type, name, fields, nfields);
    }