skip to main content
Schema Management : Implementing Schema Objects in C/C++
 

Implementing Schema Objects in C/C++

When working in C/C++, you need to implement the IP schema functions such as OASQLIP_tables. These functions can directly call your SQL engine's metadata API or you can issue a query on a table or a view that has been created in your database. OpenAccess SDK provides a set of functions that can be used to generate queries on schema objects when an IP function such as OASQLIP_tables is called. The file odbcschema.c contains code to generate the SQL query that can be then executed against your SQL engine. You can use these functions to process a schema call.
Refer to the ODBC IP example in which the odbcdrv.c and the odbcschema.c files handle the schema requests by mapping the client call to one of the ODBC schema functions. Because the ODBC schema functions return results sets that are compatible with the OpenAccess SDK schema objects, there is no need to do anything special in the OASQLIP_fetch_row or OASQLIP_get_numcols function. In OASQLIP_get_colval, a filter can be added to handle the mapping of the data types returned by the underlying ODBC data source to the types mapped during normal query processing.

See also 

OASQLIP_fetch_row
OASQLIP_get_numcols
OASQLIP_get_colval