sqlugtpi API - Get table distribution information

Allows an application to obtain the distribution information for a table.

The distribution information includes the distribution map and the column definitions of the distribution key. Information returned by this API can be passed to the sqlugrpn API to determine the database partition number and the database partition server number for any row in the table.

Beginning with Db2® 9.7, this API is deprecated. Use the db2GetDistMap (Get distribution map) API to return the distribution information. If you call the sqlugtpi API and the DB2_PMAP_COMPATIBILITY registry variable is set to OFF, the error message SQL2768N is returned.

To use this API, the application must be connected to the database that contains the table for which distribution information is being requested.

Scope

This API can be executed on any database partition server defined in the db2nodes.cfg file.

Authorization

For the table being referenced, a user must have at least one of the following authorities:
  • DATAACCESS authority
  • CONTROL privilege
  • SELECT privilege

Required connection

Database

API include file

sqlutil.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  sqlugtpi (
   unsigned char * tablename,
   struct sqlupi * part_info,
   struct sqlca * sqlca);

SQL_API_RC SQL_API_FN
  sqlggtpi (
   unsigned short tn_length,
   unsigned char * tablename,
   struct sqlupi * part_info,
   struct sqlca * sqlca);

sqlugtpi API parameters

tablename
The fully qualified name of the table.
part_info
A pointer to the sqlupi structure.
pSqlca
Output. A pointer to the sqlca structure.

sqlggtpi API-specific parameters

tn_length
A 2-byte unsigned integer with the length of the table name.