Administrative API Reference

sqlbtcq - Tablespace Container Query

Provides a one-call interface to the table space container query data. The query data for all containers in a table space, or for all containers in all table spaces, is returned in an array.

Scope

In a partitioned database server environment, only the table spaces on the current node are listed.

Authorization

One of the following:

Required Connection

Database

Version

sqlutil.h

C API Syntax



/* File: sqlutil.h */
/* API: Tablespace Container Query */
/* ... */
SQL_API_RC SQL_API_FN
  sqlbtcq (
    struct sqlca * pSqlca,
    sqluint32 TablespaceId,
    sqluint32 * pNumContainers,
    struct SQLB_TBSCONTQRY_DATA ** ppContainerData);
/* ... */
 

Generic API Syntax



/* File: sqlutil.h */
/* API: Tablespace Container Query */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgtcq (
    struct sqlca * pSqlca,
    sqluint32 TablespaceId,
    sqluint32 * pNumContainers,
    struct SQLB_TBSCONTQRY_DATA ** ppContainerData);
/* ... */
 

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, or a special ID, SQLB_ALL_TABLESPACES (defined in sqlutil), which produces a list of all containers for the entire database.

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

ppContainerData
Output. The caller supplies the API with the address of a pointer to a SQLB_TBSCONTQRY_DATA structure. The space for the table space container query data is allocated by the API, and a pointer to that space is returned to the caller. On return from the call, the pointer to the SQLB_TBSCONTQRY_DATA structure points to the complete set of table space container query data.

Sample Programs

C
\sqllib\samples\c\tabscont.sqc

COBOL
\sqllib\samples\cobol\tabscont.sqb

Usage Notes

This API uses the lower level services, namely:

to get all of the table space container query data at once.

If sufficient memory is available, this function returns the number of containers, and a pointer to the memory location of the table space container query data. It is the user's responsibility to free this memory with a call to sqlefmem (see sqlefmem - Free Memory).

If sufficient memory is not available, this function simply returns the number of containers, and no memory is allocated. If this should happen, use sqlbotcq - Open Tablespace Container Query, sqlbftcq - Fetch Tablespace Container Query, and sqlbctcq - Close Tablespace Container Query to fetch less than the whole list at once.

See Also

sqlbctcq - Close Tablespace Container Query

sqlbftcq - Fetch Tablespace Container Query

sqlbotcq - Open Tablespace Container Query

sqlbstsc - Set Tablespace Containers

sqlbtcq - Tablespace Container Query.


[ Top of Page | Previous Page | Next Page ]