IBM Books

Administrative API Reference

sqlbotcq - Open Tablespace Container Query

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

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

TablespaceId
Input. ID of the table space for which container data is desired. If the special identifier SQLB_ALL_TABLESPACES (in sqlutil) is specified, a complete list of containers for the entire database is produced.

pNumContainers
Output. The number of containers in the specified table space.

Sample Programs

C
\sqllib\samples\c\tabscont.sqc

COBOL
\sqllib\samples\cobol\tabscont.sqb

FORTRAN
\sqllib\samples\fortran\tabscont.sqf

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:

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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]