skip to main content
Interface Provider class : IP methods reference : ipSchema
 

ipSchema

You must implement this method in your IP if it is to handle the schema management. The OpenAccess SDK SQL Engine calls this method when it needs to get any of the following information about the schema:
A list of tables
Columns for a table
Details about each columns
Foreign keys
Indexes
Other schema objects
If this method is implemented, the IP takes over the responsibility of exposing the OA_TABLES, OA_COLUMNS, OA_STATISTICS, OA_FKEYS, OA_PROC and OA_PROCCOLUMNS tables. The ipGetSupport method should return true for IP_SUPPORT_SCHEMA.
The implementation should use the search conditions that are passed in, and should cache any schema information that is time-consuming to retrieve. Return 0 or more objects matching the requested schema information type and the associated search filter.
int ipSchema(
int64 dam_hdbc,
int64 pMemTree,
int iType,
int64 pList,
object pSearchObj)
 
 
Table 28: Parameters for ipSchema 
Parameter
Type
Description
IN
 
 
dam_hdbc
int64
The OpenAccess SDK SQL Engine connection handle
pMemTree
int64
The memory tree to be used for all memory allocation
iType
int
The type of schema information requested:
DAMOBJ_TYPE_CATALOG – The Catalog/Qualifier information as defined by OA_TABLES.
DAMOBJ_TYPE_SCHEMA – The Schema/Owner information as defined by OA_TABLES.
DAMOBJ_TYPE_TABLETYPE – The table types information as defined by OA_TABLES.
DAMOBJ_TYPE_TABLE – The tables information as defined by OA_TABLES.
DAMOBJ_TYPE_COLUMN – The columns information as defined by OA_COLUMNS.
DAMOBJ_TYPE_STAT – The index information as defined by OA_STATISTICS.
DAMOBJ_TYPE_FKEY – The foreign key information as defined by OA_FKEYS.
DAMOBJ_TYPE_PROC – The procedures information as defined by OA_PROC.
DAMOBJ_TYPE_PROC_COLUMN – The procedure columns information as defined by OA_PROCCOLUMNS.
pList
int64
Requested object(s) are returned by placing them in this list using the dam_add_schemaobj calls. The IP can pass the pSearchObj filter to the dam_add_schemaobj method to have the OpenAccess SDK SQL Engine filter the objects before adding to the list.
pSearchObj
object
Contains the information about search conditions for the requested object type. The IP and the OpenAccess SDK SQL Engine use this information to filter the information returned by the IP. For example, if the OpenAccess SDK SQL Engine needs only the columns for a specific table, it sets the table_name in the pSearchObj. The IP must use this information or pass the pSearchObj to the OpenAccess SDK SQL Engine when calling the dam_add_schemaobj method. It is NULL if no search criteria is specified. For example, if the user issues the query:
SELECT * FROM oa_tables
then pSearchObj is null and the IP returns all the table objects. Access this data by typecasting this pointer based on the requested object type (iType) and then accessing the members of the object to retrieve the required information:
DAMOBJ_TYPE_CATALOG – schemaobj_table
DAMOBJ_TYPE_SCHEMA – schemaobj_table
DAMOBJ_TYPE_TABLETYPE – schemaobj_table
DAMOBJ_TYPE_TABLE – schemaobj_table
DAMOBJ_TYPE_COLUMN – schemaobj_column
DAMOBJ_TYPE_STAT – schemaobj_stat
DAMOBJ_TYPE_FKEY – schemaobj_fkey
DAMOBJ_TYPE_PKEY – schemaobj_pkey
DAMOBJ_TYPE_PROC – schemaobj_proc
DAMOBJ_TYPE_PROC_COLUMN – schemaobj_proccolumn
Similarly, if the OpenAccess SDK SQL Engine only needs the schema for a specific table, it sets the schema name in the pSearchObj. The IP must use this information or pass the pSearchObj to the OpenAccess SDK SQL Engine when calling dam_add_damobjW(). It is NULL if no search criteria is specified.
RETURN
 
 
 
int
DAM_SUCCESS – on success
DAM_FAILURE – on failure

See also 

dam_add_schemaobj
ipGetSupport