Home > Contents > Index >
HISTORY
Gets a revision history for rows in a revision tracked table.
Syntax
<HISTORY TABLE="TABLE_NAME" LIST="QUERY_OBJECT" [ASSET="PRIMARY_KEY"] [VERSION="VERSION_NUM"] [LOCKER="LOCK_USER"] [CREATOR="CREATE_USER"] [ANNOTATION="COMMENT"]/>Parameters
TABLE (required)
- Name of the tracked table.
LIST (required)
- List containing the returned results.
ASSET (optional)
- Value of the primary key for the row whose history to retrieve.
VERSION (optional)
- Version number.
LOCKER (optional)
- Filter rows returned based on a user who has rows locked. If the current user does not have
rtaudit
privileges, you must specify a value forLOCKER
,CREATOR
, or both. If you specify onlyLOCKER
, the value must be the current users name; otherwise, no data is returned.
CREATOR (optional)
- Filter rows returned based on the user who created the row. If the current user does not have
rtaudit
privileges, you must specify a value forLOCKER
,CREATOR
, or both. If you specify onlyCREATOR
, the value must be the current users name; otherwise, no data is returned.
ANNOTATION (optional)
- Filter rows returned based on the annotation of a row.
Description
The
HISTORY
tag gets a revision history for rows in a revision tracked table.To obtain history for all rows, the current user must have
rtaudit
privileges on the table. If the current user has read privileges on the table, only history on the revisions which the user has created or locked is returned.Error Numbers
The possible values of
errno
include:
Value Description -1000 Command failure. Check theerrdetail
variable for the specific variable.Example
This example assumes all
HISTORY
parameters are exposed on an HTML form. It first checks whether the parameters exist, clears any values fromerrno
, then checks the history.!-- Make sure required parameters exist --> <IF COND="IsVariable.tablename=false"> <THEN> <SETVAR NAME="tablename" VALUE=""/> </THEN> </IF> <IF COND="IsVariable.asset=false"> <THEN> <SETVAR NAME="asset" VALUE=""/> </THEN> </IF> <IF COND="IsVariable.version=false"> <THEN> <SETVAR NAME="version" VALUE=""/> </THEN> </IF> <IF COND="IsVariable.locker=false"> <THEN> <SETVAR NAME="locker" VALUE=""/> </THEN> </IF> <IF COND="IsVariable.creator=false"> <THEN> <SETVAR NAME="creator" VALUE=""/> </THEN> </IF> <IF COND="IsVariable.annotation=false"> <THEN> <SETVAR NAME="annotation" VALUE=""/> </THEN> </IF> <!-- clear out errno --> <SETVAR NAME="errno" VALUE="0"/> <!-- get the history --> <HISTORY TABLE="Variables.tablename" LIST="historyResult" ASSET="Variables.asset" VERSION="Variables.version" LOCKER="Variables.locker" CREATOR="Variables.creator" ANNOTATION="Variables.annotation"/> <!-- See if history succeeded --> <IF COND="Variables.errno=0"> <THEN> <!-- If succeeded, report it --> <TABLE CELLPADDING="2" CELLSPACING="4"> <TR> <TH>Asset</TH><TH>Version Number</TH> <TH>Version Date</TH><TH>Created by</TH> <TH>Locked by</TH><TH>Comment</TH> </TR> <LOOP LIST="historyResult"/> <TR> <TD><CSVAR NAME="historyResult.asset"/></TD> <TD><CSVAR NAME="historyResult.versionnum"/> </TD> <TD><CSVAR NAME="historyResult.versiondate"/> </TD> <TD><CSVAR NAME="historyResult.createdby"/> </TD> <TD><CSVAR NAME="historyResult.lockedby"/> </TD> <TD><CSVAR NAME="historyResult.annotation"/> </TD> </TR> </LOOP> </TABLE> </THEN> <ELSE> <!-- otherwise, call an error reporting element --> History failed.<BR/> </ELSE> </IF>See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.