IBM Books

Administrative API Reference

sqlbmtsq - Tablespace Query

Provides a one-call interface to the table space query data. The query data for all table spaces in the database 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 Query */
/* ... */
SQL_API_RC SQL_API_FN
  sqlbmtsq (
    struct sqlca * pSqlca,
    unsigned long * pNumTablespaces,
    struct SQLB_TBSPQRY_DATA *** pppTablespaceData,
    unsigned long reserved1,
    unsigned long reserved2);
/* ... */
 

Generic API Syntax



/* File: sqlutil.h */
/* API: Tablespace Query */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgmtsq (
    struct sqlca * pSqlca,
    unsigned long * pNumTablespaces,
    struct SQLB_TBSPQRY_DATA *** pppTablespaceData,
    unsigned long reserved1,
    unsigned long reserved2);
/* ... */
 

API Parameters

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

pNumTablespaces
Output. The total number of table spaces in the connected database.

pppTablespaceData
Output. The caller supplies the API with the address of a pointer. The space for the table space 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 points to an array of SQLB_TBSPQRY_DATA pointers to the complete set of table space query data.

reserved1
Input. Always SQLB_RESERVED1.

reserved2
Input. Always SQLB_RESERVED2.

Sample Programs

C
\sqllib\samples\c\tabspace.sqc

COBOL
\sqllib\samples\cobol\tabspace.sqb

FORTRAN
\sqllib\samples\fortran\tabspace.sqf

Usage Notes

This API uses the lower level services, namely:

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

If sufficient memory is available, this function returns the number of table spaces, and a pointer to the memory location of the table space 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 table spaces, and no memory is allocated. If this should happen, use sqlbotsq - Open Tablespace Query, sqlbftpq - Fetch Tablespace Query, and sqlbctsq - Close Tablespace Query, to fetch less than the whole list at once.

See Also

sqlbctsq - Close Tablespace Query

sqlbftpq - Fetch Tablespace Query

sqlbgtss - Get Tablespace Statistics

sqlbotsq - Open Tablespace Query

sqlbstpq - Single Tablespace Query.


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

[ DB2 List of Books | Search the DB2 Books ]