Prepares for a table space container query operation, and returns the number of containers currently in the table space.
Authorization
One of the following:
Required Connection
Database
Version
sqlutil.h
C API Syntax
/* File: sqlutil.h */ /* API: Open Tablespace Container Query */ /* ... */ SQL_API_RC SQL_API_FN sqlbotcq ( struct sqlca * pSqlca, unsigned long TablespaceId, unsigned long * pNumContainers); /* ... */ |
Generic API Syntax
/* File: sqlutil.h */ /* API: Open Tablespace Container Query */ /* ... */ SQL_API_RC SQL_API_FN sqlgotcq ( struct sqlca * pSqlca, unsigned long TablespaceId, unsigned long * pNumContainers); /* ... */ |
API Parameters
Sample Programs
Usage Notes
This API is normally followed by one or more calls to sqlbftcq - Fetch Tablespace Container Query, and then by one call to sqlbctcq - Close Tablespace Container Query.
An application can use the following APIs to fetch information about containers in use by table spaces:
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, and 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 - Free Memory 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 - Tablespace Container Query).
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.
See Also
sqlbctcq - Close Tablespace Container Query
sqlbftcq - Fetch Tablespace Container Query
sqlbstsc - Set Tablespace Containers
sqlbtcq - Tablespace Container Query.