Prepares for a table space container query operation, and returns the number of containers currently in the table space.
Database
sqlutil.h
SQL_API_RC SQL_API_FN
sqlbotcq (
struct sqlca * pSqlca,
sqluint32 TablespaceId,
sqluint32 * pNumContainers);
SQL_API_RC SQL_API_FN
sqlgotcq (
struct sqlca * pSqlca,
sqluint32 TablespaceId,
sqluint32 * pNumContainers);
This API is normally followed by one or more calls to sqlbftcq, and then by one call to sqlbctcq.
Fetches a complete list of container information. The API allocates the space required to hold the information for all the containers, and returns a pointer to this information. Use this API to scan the list of containers for specific information. Using this API is identical to calling the three APIs below (sqlbotcq, sqlbftcq, sqlbctcq), except that this API automatically allocates the memory for the output information. A call to this API must be followed by a call to sqlefmem to free the memory.
These three APIs function like an SQL cursor, in that they use the OPEN/FETCH/CLOSE paradigm. The caller must provide the output area for the fetch. Unlike an SQL cursor, only one table space container query can be active at a time. Use this set of APIs to scan the list of table space containers for specific information. These APIs allows the user to control the memory requirements of an application (compared with sqlbtcq).
When sqlbotcq is called, a snapshot of the current container information is formed in the agent servicing the application. If the application issues a second table space container query call (sqlbtcq or sqlbotcq), this snapshot is replaced with refreshed information.
No locking is performed, so the information in the buffer may not reflect changes made by another application after the snapshot was generated. The information is not part of a transaction.
There is one snapshot buffer for table space queries and another for table space container queries. These buffers are independent of one another.