The following example demonstrates how to provide schema information of CURVALUE to the OpenAccess SDK.
To provide schema information of the CURVALUE table function to OpenAccess SDK:
1. In the OAIP_schemaW function, under ’case DAMOBJ_TYPE_TABLE:’ use dam_add_damobj_tableW() function to add the table function schema object. Before adding the object, use dam_isSchemaTableFunctionW() to check whether the schema object being added is a table function or a table.
if(dam_isSchemaTableFunctionW(pSearchTableObj))
{
if (xxx_is_matching_tableW(pSearchTableObj, XXX_QUALIFIER_NAME_W, XXX_USER_NAME_W,
2. In the OAIP_schemaW function, under ‘case DAMOBJ_TYPE_COLUMN:’use pSearchColumnObj->pTableObj to check whether the column belongs to a table or to a table function. For table functions, pSearchColumnObj->pTableObj is NOT NULL; for a table, it is set to NULL.
Pass the search object to dam_getTableFunctionArgList()and obtain the table function’s parameter list. Use dam_getFirstValExp() and dam_getNextValExp() to iterate through the list of parameters; then use dam_add_damobj_column() to add the table function column schema object.
if (pSearchColumnObj)
{
/*If pSearchColumnObj->pTableObj is not NULL then IP Schema needs to return
3. In the OAIP_schemaW function, under ‘case DAMOBJ_TYPE_STAT:’ use pSearchStatObj->pTableObj to check whether the statistics belong to a table or a table function. For CURVALUE pSearchColumnObj->pTableObj is NOT NULL; for a table it is set to NULL.
Then use dam_add_damobj_stat() to add the statistic schema objects for CURVALUE.
if(pSearchStatObj)
{
/*If pSearchColumnObj->pTableObj is not NULL then IP Schema needs
to return statistics information for TableFunction*/