DB2 Version 10.1 for Linux, UNIX, and Windows

db2AddSnapshotRequest API - Add a snapshot request

Prepares the snapshot request stream for db2GetSnapshotSize and db2GetSnapshot.

Scope

Prepares the snapshot request stream for the db2GetSnapshotSize and db2GetSnapshot APIs. The output (a snapshot request that is generated by the db2AddSnapshotRequest API) is passed to the db2GetSnapshotSize and db2GetSnapshot APIs. A snapshot request contains the snapshot request type and the identification information.

Authorization

None.

Required connection

None.

API include file

db2ApiDf.h

API and data structure syntax

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

typedef SQL_STRUCTURE db2AddSnapshotRqstData
{
   void *pioRequestData;
   db2Uint32 iRequestType;
   db2int32 iRequestFlags;
   db2Uint32 iQualType;
   void *piQualData;
} db2AddSnapshotRqstData;

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

typedef SQL_STRUCTURE db2gAddSnapshotRqstData
{
   void *pioRequestData;
   db2Uint32 iRequestType;
   db2int32 iRequestFlags;
   db2Uint32 iQualType;
   void *piQualData;
   db2Uint32 iQualDataLen;
} db2gAddSnapshotRqstData;

db2AddSnapshotRequest API parameters

versionNumber
Input. Specifies the version and release level of the structure passed as the second parameter pParmStruct. To use the structure db2AddSnapshotData as described previously, specify db2Versio910. If you want to use a different version of this structure, check the db2ApiDf header file in the include directory for the complete list of supported versions. Ensure that you use the version of the db2AddSnapshotRequestData structure that corresponds to the version number that you specify.
pParmStruct
Input or output, or both. A pointer to the db2AddSnapshotRequestData structure.
pSqlca
Output. A pointer to the sqlca structure.

db2AddSnapshotRqstData data structure parameters

pioRequestData
Input/output. The request data to be constructed by the db2AddSnapshotRequest API. Initially, this parameter is set to NULL. The memory required for pioRequestData will be allocated by the db2AddSnapshotRequest API. You should free pioRequestData when its usage ends (for example, after the db2GetSnapshot API call).
iRequestType
Input. Snapshot request type, for example, SQLMA_DB2.
iRequestFlags
Input. Bit mapped action flags, the values are SQLM_INSTREAM_ADD_REQUEST, SQLM_INSTREAM_ADD_QUAL or SQLM_INSTREAM_ADD_REQQUAL. If iRequestFlags is not set by the caller:
  • if iRequestType is set, iRequestFlags bit SQLM_INSTREAM_ADD_REQUEST is turned on by the API.
  • if piQualifierData pointer is not null, SQLM_INSTREAM_ADD_QUAL is turned on by the API.

Upon API call, iRequestType, iQualifierType, iRequestFlags and piQualifierData are reset to 0.

iQualType
Input. Type of the qualifier attached to the snapshot request, for example, SQLM_INSTREAM_ELM_DBNAME.
piQualData
Input. Data describing the qualifier. This is a pointer to a null-terminated string.

db2gAddSnapshotRqstData data structure specific parameters

iQualDataLen
Input. Length of the qualifier data in the piQualData parameter.