DB2 Version 9.7 for Linux, UNIX, and Windows

db2HistoryGetEntry API - Get the next entry in the database history records

Gets the next entry from the database history records. This API must be preceded by a successful call to the db2HistoryOpenScan API.

Note: The language support for COBOL and FORTRAN has been deprecated for this API and might be discontinued in a future release. Use the following supported alternatives:
  • Build your application using C, C++, or Java™.
  • Access database history records by using the DB_HISTORY administrative view.

Authorization

None

Required connection

Instance. It is not necessary to call sqleatin before calling this API.

API include file

db2ApiDf.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  db2HistoryGetEntry (
       db2Uint32 versionNumber,
       void * pParmStruct,
       struct sqlca * pSqlca);

typedef SQL_STRUCTURE db2HistoryGetEntryStruct
{
   struct db2HistoryData *pioHistData;
   db2Uint16 iHandle;
   db2Uint16 iCallerAction;
} db2HistoryGetEntryStruct;

SQL_API_RC SQL_API_FN
  db2gHistoryGetEntry (
       db2Uint32 versionNumber,
       void * pParmStruct,
       struct sqlca * pSqlca);

db2HistoryGetEntry API parameters

versionNumber
Input. Specifies the version and release level of the structure passed in as the second parameter, pParmStruct.
pParmStruct
Input. A pointer to the db2HistoryGetEntryStruct structure.
pSqlca
Output. A pointer to the sqlca structure.

db2HistoryGetEntryStruct data structure parameters

pioHistData
Input. A pointer to the db2HistData structure.
iHandle
Input. Contains the handle for scan access that was returned by the db2HistoryOpenScan API.
iCallerAction
Input. Specifies the type of action to be taken. Valid values (defined in db2ApiDf header file, located in the include directory) are:
DB2HISTORY_GET_ENTRY
Get the next entry, but without any command data.
DB2HISTORY_GET_DDL
Get only the command data from the previous fetch.
DB2HISTORY_GET_ALL
Get the next entry, including all data.

Usage notes

The records that are returned will have been selected using the values specified in the call to the db2HistoryOpenScan API.

For a detailed description of the use of the database history records APIs, refer to the db2HistoryOpenScan API.

REXX API syntax

GET RECOVERY HISTORY FILE ENTRY :scanid [USING :value]

REXX API parameters

scanid
Host variable containing the scan identifier returned from OPEN RECOVERY HISTORY FILE SCAN.
value
A compound REXX host variable into which the database history records entry information is returned. In the following, XXX represents the host variable name:
XXX.0
Number of first level elements in the variable (always 15)
XXX.1
Number of table space elements
XXX.2
Number of used table space elements
XXX.3
OPERATION (type of operation performed)
XXX.4
OBJECT (granularity of the operation)
XXX.5
OBJECT_PART (time stamp and sequence number)
XXX.6
OPTYPE (qualifier of the operation)
XXX.7
DEVICE_TYPE (type of device used)
XXX.8
FIRST_LOG (earliest log ID)
XXX.9
LAST_LOG (current log ID)
XXX.10
BACKUP_ID (identifier for the backup)
XXX.11
SCHEMA (qualifier for the table name)
XXX.12
TABLE_NAME (name of the loaded table)
XXX.13.0
NUM_OF_TABLESPACES (number of table spaces involved in backup or restore)
XXX.13.1
Name of the first table space backed up/restored
XXX.13.2
Name of the second table space backed up/restored
XXX.13.3
and so on
XXX.14
LOCATION (where backup or copy is stored)
XXX.15
COMMENT (text to describe the entry).