Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

dam_add_damobj_stat

  • Last Updated: May 12, 2026
  • 5 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

This function is used to return schema information about table indexes and table statistics. Add a statistic schema object with the specified values to the list of objects returned to the OpenAccess SDK SQL engine. Use the Unicode versions when using this function: OAIP_schemaW or OAIP_schemaExW.

All values should be set. Set Null values as follows:

  • For char *, set the pointer to NULL.
  • For integer, set the value to DAMOBJ_NOTSET.

Refer to Schema Definition and Management in the OpenAccess SDK Programmer's Guide for information about each of the values to set.

int dam_add_damobj_stat(
    XM_Tree   *   pMemTree, 
    DAM_OBJ_LIST  pList, 
    DAM_OBJ       pSearchObj, 
    char     *    table_qualifier, 
    char     *    table_owner,
    char     *    table_name, 
    short         non_unique, 
    char     *    index_qualifier,
    char     *    index_name, 
    short         type, 
    short         seq_in_index, 
    char     *    column_name,
    char     *    collation,  
    int64         cardinality, 
    long          pages,
    char     *    filter_conditions)

Parameters for add_damobj_stat

Parameter Type Description
IN
pMemTree XM_Tree * The memory tree on which to allocate memory for the new object.
pList DAM_OBJ_LIST The list on which the objects are to be added, which is passed in the call to the IP. The IP can pass the pSearchObj filter to have the OpenAccess SDK SQL engine filter the objects before adding to the list.
pSearchObj DAM_OBJ The object to use for filtering the objects added to the list. If you have taken care of only adding the object that are requested, then set this to NULL. If you want the OpenAccess SDK SQL engine to do the filtering, then pass in the same value as passed into your IP.
table_qualifier char * The name of the database in which the table resides. It can be used to distribute tables into physically different databases. You would normally specify SCHEMA. The entry here is the same as you use in OA_COLUMNS and OA_TABLES.
table_owner char * The owner of the table. You would normally set it to system or user.
table_name char * The name of the table. This is how the end user refers to it.
non_unique short Indicates whether the index prohibits duplicate values:
TRUE (1) - the index values can be non-unique.
FALSE (0) - the index values must be unique.
NULL (empty) - if type is SQL_TABLE_STAT.
index_qualifier char * The name of the database to which the table belongs.
index_name char * The name of the index. This value must be NULL if type is SQL_TABLE_STAT.
type short The type of information returned. You should specify 1, 2, or 3 as the value for Microsoft Access to use the indexes. Valid values are:
SQL_TABLE_STAT (0) - a statistic for the table
SQL_INDEX_CLUSTERED (1) - a clustered index
SQL_INDEX_HASHED (2) - a hashed index
SQL_INDEX_OTHER (3) - another type of index
seq_in_index short The column sequence number in the index, starting with 1. Set to NULL if type is SQL_TABLE_STAT. This value is 1 if only one column defines the index.
column_name char * The column identifier. Set to NULL if type is SQL_TABLE_STAT.
collation char * The collation sequence. Valid values are:
A - ascending
D - descending
NULL - if type is SQL_TABLE_STAT or if no collation.
cardinality int64 The cardinality of the table or index. Used by the OpenAccess SDK SQL engine to use an optimal index if this is not a unique index. Valid values are:
  • The number of rows in the table if type is SQL_TABLE_STAT.
  • The number of unique values in the index if type is not SQL_TABLE_STAT. High cardinality indexes are preferred for query optimization.
  • NULL if the value is not available from the data source.
  • pages long Reserved for future use.
    filter_conditions char * Reserved for future use.
    RETURN
    int Function call status:
    DAM_SUCCESS - values set
    DAM_FAILURE - values not set. One of the values was null when it cannot be.
        XM_Tree *     pMemTree, 
        DAM_OBJ_LIST  pList, 
        DAM_OBJ       pSearchObj,   
        CHAR *        table_qualifier,
        CHAR *        table_owner,
        CHAR *        table_name,
        short         non_unique,
        CHAR *        index_qualifier,
        CHAR *        index_name,
        short         type,
        short         seq_in_index,
        CHAR *        column_name,
        CHAR *        collation,
        int64         cardinality,
        long          pages,
        CHAR *        filter_conditions)
    

    Parameters for add_damobj_statW

    Parameter Type Description
    IN
    pMemTree XM_Tree * The memory tree on which to allocate memory for the new object.
    pList DAM_OBJ_LIST The list on which the objects are to be added. It is passed in the call to the IP. The IP can pass the pSearchObj filter to have the OpenAccess SDK SQL engine filter the objects before adding to the list.
    pSearchObj DAM_OBJ The object to use for filtering the objects added to the list. If you have taken care of only adding the object that are requested, then set this to NULL. If you want the OpenAccess SDK SQL engine to do the filtering, then pass in the same value as passed into your IP.
    table_qualifier CHAR * The name of the database in which the table resides. It can be used to distribute tables into physically different databases. You would normally specify SCHEMA. The entry here is the same as you use in OA_COLUMNS and OA_TABLES.
    table_owner CHAR * The owner of the table. You would normally set it to system or user.
    table_name CHAR * The name of the table. This is how the end user refers to it.
    non_unique short Indicates whether the index prohibits duplicate values:
    TRUE (1) - the index values can be non-unique.
    FALSE (0) - the index values must be unique.
    NULL (empty) - if type is SQL_TABLE_STAT.
    index_qualifier CHAR * The name of the database to which the table belongs.
    index_name CHAR * The name of the index. This value must be NULL if type is SQL_TABLE_STAT.
    type short The type of information returned. You should specify 1, 2, or 3 as the value for Microsoft Access to use the indexes. Valid values are:
    SQL_TABLE_STAT (0) - a statistic for the table
    SQL_INDEX_CLUSTERED (1) - a clustered index
    SQL_INDEX_HASHED (2) - a hashed index
    SQL_INDEX_OTHER (3) - another type of index
    seq_in_index short The column sequence number in the index, starting with 1. Set to NULL if type is SQL_TABLE_STAT. This value is 1 if only one column defines the index.
    column_name CHAR * The column identifier. Set to NULL if type is SQL_TABLE_STAT.
    collation CHAR * The collation sequence. Valid values are:
    A - ascending
    D - descendingNULL - if type is SQL_TABLE_STAT or if no collation.
    cardinality int64 The cardinality of the table or index. Used by the OpenAccess SDK SQL engine to use an optimal index if this is not a unique index. Valid values are:
  • The number of rows in the table if type is SQL_TABLE_STAT.
  • The number of unique values in the index if type is not SQL_TABLE_STAT.
    High cardinality indexes are preferred for query optimization.
  • NULL if the value is not available from the data source.
  • pages long Reserved for future use.
    filter_conditions CHAR * Reserved for future use.
    RETURN
    int Function call status
    DAM_SUCCESS - values set
    DAM_FAILURE - values not set. One of the values was null when it cannot be.
    TitleResults for “How to create a CRG?”Also Available inAlert