DB2 Version 9.7 for Linux, UNIX, and Windows

sqlbmtsq API - Get the query data for all table spaces

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.

Important: This command or API has been deprecated and might be removed in a future release. You can use the MON_GET_TABLESPACE and the MON_GET_CONTAINER table functions instead which return more information. For more information, see LIST TABLESPACES and LIST TABLESPACE CONTAINERS commands have been deprecated.

Scope

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

Authorization

One of the following:
  • sysadm
  • sysctrl
  • sysmaint
  • sysmon
  • dbadm
  • load

Required connection

Database

API include file

sqlutil.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  sqlbmtsq (
   struct sqlca * pSqlca,
   sqluint32 * pNumTablespaces,
   struct SQLB_TBSPQRY_DATA *** pppTablespaceData,
   sqluint32 reserved1,
   sqluint32 reserved2);

SQL_API_RC SQL_API_FN
  sqlgmtsq (
   struct sqlca * pSqlca,
   sqluint32 * pNumTablespaces,
   struct SQLB_TBSPQRY_DATA *** pppTablespaceData,
   sqluint32 reserved1,
   sqluint32 reserved2);

sqlbmtsq API parameters

pSqlca
Output. A pointer to the sqlca structure.
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.

Usage notes

This API uses the lower level services, namely:
  • sqlbotsq
  • sqlbftpq
  • sqlbctsq
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.

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, sqlbftpq, and sqlbctsq, to fetch less than the whole list at once.