DB_TRANSACTION_RECORD_INFO table function
The DB_TRANSACTION_RECORD_INFO table function returns the record level status of local database files under commitment control for a commitment definition.
The information returned is similar to the values shown by Display Record Level Status within the Work with Commitment Definitions (WRKCMTDFN) CL command.
Authorization: None required when the creator of the commitment definition matches the effective user of the thread. Otherwise, the caller must have *JOBCTL special authority or be authorized to the QIBM_DB_SQLADM or QIBM_DB_SYSMON function usage identifier.
- lock-space-id
- A character string that contains the lock space identifier of the commitment definition to use.
The result of the function is a table containing rows with the format shown in the following table. All the columns are nullable.
Column Name | Data Type | Description |
---|---|---|
LIBRARY_NAME | VARCHAR(10) | The name of the library that contains the file. |
FILE_NAME | VARCHAR(10) | The name of the local database file under commitment control for the commitment definition. |
MEMBER_NAME | VARCHAR(10) | The name of the member in the file. |
FILE_CHANGES_COMMITTED | BIGINT | The total number of record level changes to the file that have
been committed. Returns the value 2,147,483,648 when more than 2,147,483,647 changes have been committed. Contains the null value if the file is closed or if an IPL has been performed on the system since the commitment definition was created. |
FILE_CHANGES_ROLLED_BACK | BIGINT | The total number of record level changes to the file that have
been rolled back. Returns the value 2,147,483,648 when more than 2,147,483,647 changes have been rolled back. Contains the null value if an IPL has been performed on the system since the commitment definition was created. |
FILE_CHANGES_PENDING | BIGINT | The total number of record level changes to the file that are
pending a commit or rollback for the commitment definition. Returns the value 2,147,483,648 when more than 2,147,483,647 changes are pending. Contains the null value if an IPL has been performed on the system since the commitment definition was created. |
LOCK_LEVEL | VARCHAR(5) | The level of record locking for this file.
Contains the null value if the file is closed. |
STATUS | VARCHAR(13) | File status.
|
CONCURRENT_ACCESS_RESOLUTION | VARCHAR(7) | The concurrent access resolution setting for this file.
Contains the null value if the file is closed. |
JOURNAL_LIBRARY | VARCHAR(10) | The library that contains the journal. Contains the null value if JOURNAL_NAME is *MULTIPLE. |
JOURNAL_NAME | VARCHAR(10) | The journal in which changes to the file are recorded. Can
contain the following special value:
|
COMMIT_CYCLE | DECIMAL(21,0) | The commit cycle identifier of the current logical unit of work
(LUW) for this file's journal. The commit cycle identifier is the sequence number of the journal
entry that corresponds to the beginning of the current LUW for the commitment definition.
Contains the null value if no changes have been made to local database files under commitment control, and no user journal entries have been sent to this journal on behalf of an API resource that is journaled to the file's journal during this LUW. |
Example
- View all the files associated with a given commit definition.
SELECT * FROM TABLE(QSYS2.DB_TRANSACTION_RECORD_INFO('UDB_0100000000000001'));
- View all the files with pending changes for a given commit definition.
SELECT * FROM TABLE(QSYS2.DB_TRANSACTION_RECORD_INFO('UDB_0100000000000001')) WHERE FILE_CHANGES_PENDING > 0;