skip to main content
Interface Provider API : Reference : OAIP_schemaEx, OAIP_schemaExW
 

OAIP_schemaEx, OAIP_schemaExW

One of these optional functions must be implemented by the IP, if the IP is to handle stored procedures with one or more run-time defined result sets. The OpenAccess SDK SQL engine calls this function to get a list of procedure result columns. The GETSUPPORT function should return true for IP_SUPPORT_SCHEMA.
Note: This function is not required if the output result set of the stored procedure is fixed regarding what columns are returned, and if you are only returning one result set.

OAIP_schemaEx (8-bit character version)

int OAIP_schemaEx(
    DAM_HSTMT hstmt,
    XM_Tree * pMemTree,
    int iType,
    DAM_OBJ_LIST pList,
    DAM_OBJ pSearchObj)
Table 27. Parameters for OAIP_schemaEx (8-bit Character Version)
Parameter
Type
Description
IN
hstmt
DAM_HSTMT
The OpenAccess SDK SQL engine statement handle.
pMemTree
XM_Tree *
The memory tree to be used for all memory allocation.
iType
int
The type of schema information requested.
DAMOBJ_TYPE_PROC_COLUMN - procedure columns information as defined by OA_PROCCOLUMNS.
pSearchObj
DAM_OBJ
Contains the information about search conditions for the requested object type. This information is used by the IP and by the OpenAccess SDK SQL engine to filter out the information returned by the IP. For example, if OpenAccess SDK SQL engine only needs 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_damobj_xxxxx functions. 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 should return 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 structure to retrieve the required information:
DAMOBJ_TYPE_PROC - damobj_proc *
OUT
pList
DAM_OBJ_LIST
Requested object(s) are returned by placing them in this list using the dam_add_damobj_xxxxx() calls. The IP can pass the pSearchObj filter to dam_add_obj() to have the OpenAccess SDK SQL engine filter the objects before adding to the list.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure

OAIP_schemaExW (Unicode Version)

The Unicode version of this function has the same arguments as the 8-bit character version but the code in this function must use the Unicode versions of schema functions and schema data types to access the search object and to allocate and add the schema objects.
int OAIP_schemaExW(
    DAM_HSTMT      hstmt,
    XM_Tree      * pMemTree,
    int             iType,
    DAM_OBJ_LIST    pList,
    DAM_OBJ         pSearchObj)
Table 28. Parameters for OAIP_schemaExW (Unicode Version)
Parameter
Type
Description
IN
hstmt
DAM_HSTMT
The OpenAccess SDK SQL engine statement handle.
pMemTree
XM_Tree *
The memory tree to be used for all memory allocation.
iType
int
The type of schema information requested:
DAMOBJ_TYPE_PROC_COLUMN - procedure columns information as defined by OA_PROCCOLUMNS.
pSearchObj
DAM_OBJ
Contains the information about search conditions for the requested object type. This information is used by the IP and by the OpenAccess SDK SQL engine to filter out the information returned by the IP.
For example, if the OpenAccess SDK SQL engine only needs 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_damobj_xxxxxW functions. 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 should return all table objects. Access this data by typecasting this pointer based on the requested object type (iType) and then accessing the members of the structure to retrieve the required information:
DAMOBJ_TYPE_PROC - damobj_procW *
OUT
pList
DAM_OBJ_LIST
Requested object(s) are returned by placing them in this list using the dam_add_damobj_xxxxW function calls.
The IP can pass the pSearchObj filter to the dam_add_damobj_xxxxW functions to have the OpenAccess SDK SQL engine filter the objects before adding to the list.
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure