Prepares for a table space query operation, and returns the number of table spaces currently in the database.
Database
sqlutil.h
SQL_API_RC SQL_API_FN
sqlbotsq (
struct sqlca * pSqlca,
sqluint32 TablespaceQueryOptions,
sqluint32 * pNumTablespaces);
SQL_API_RC SQL_API_FN
sqlgotsq (
struct sqlca * pSqlca,
sqluint32 TablespaceQueryOptions,
sqluint32 * pNumTablespaces);
This API is normally followed by one or more calls to sqlbftpq, and then by one call to sqlbctsq.
Fetches information about a given table space. Only one table space entry is returned (into a space provided by the caller). Use this API when the table space identifier is known, and information about only that table space is desired.
Fetches information about all table spaces. The API allocates the space required to hold the information for all table spaces, and returns a pointer to this information. Use this API to scan the list of table spaces when searching for specific information. Using this API is identical to calling the three APIs mentioned in the following list, 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 query may be active at a time. Use this set of APIs to scan the list of table spaces when searching for specific information. This set of APIs allows the user to control the memory requirements of an application (compared with sqlbmtsq).
When sqlbotsq is called, a snapshot of the current table space information is buffered in the agent servicing the application. If the application issues a second table space query call (sqlbmtsq or sqlbotsq), this snapshot is replaced with refreshed information.
No locking is performed, so the information in the buffer may not reflect more recent changes made by another application. 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.