Home > Contents > Index >
ROLLBACK
Reverts a row in a tracked table to a previous revision.
Syntax
<ROLLBACK TABLE="TABLE_NAME" ASSET="PRIMARY_KEY" [VERSION="VERSION_NUM"]/>Parameters
TABLE (required)- Name of the table containing the row you want to revert to a previous version.
ASSET (required)- Value of the primary key for the row you want to revert to a previous version.
VERSION (optional)- Version to make current. Values for
VERSION_NUMare:
- "
first"- Roll back to earliest revision of record.- "
last"- Roll back to most recent revision of record.- "
#"- Roll back to a specific revision number.- "
date"- Roll back the record to whatever revision was current at the specified date. The date must be in SQL format (yyyy-mm-dd hh:mm:ss) and is expected to be GMT.Description
The
ROLLBACKtag reverts a row in a tracked table to a previous revision. The current user must have the row locked and havertauditprivileges against the table to roll back the row. A row can be rolled back to its earliest revision, its most recent revision, a specific version number, or whatever revision was current at a specified date.Error Numbers
The possible values of
errnoinclude:
Value Description -1000 Command failure. Check theerrdetailvariable for the specific error.Example
This example assumes all
ROLLBACKparameters are exposed on an HTML form. It first checks whether the parameters exist, clears any values fromerrno, and then performs a roll back on the row.
<!-- Make sure required parameters exist --> <IFCOND="IsVariable.tablename=false"> <THEN> <SETVARNAME="tablename" VALUE=""/> </THEN> </IF> <IFCOND="IsVariable.asset=false"> <THEN> <SETVARNAME="asset" VALUE=""/> </THEN> </IF> <IFCOND="IsVariable.version=false"> <THEN> <SETVARNAME="version" VALUE=""/> </THEN> </IF> <!-- clear out errno --> <SETVARNAME="errno" VALUE="0"/> <!-- do the rollback --> <ROLLBACK TABLE="Variables.tablename" ASSET="Variables.asset" VERSION="Variables.version"/> <!-- see if the rollback succeeded --> <IFCOND="Variables.errno=0"> <THEN> <!-- if succeeded, note it--> Rollback succeeded for <CSVARNAME="Variables.asset"/> <BR/> </THEN> <ELSE> <!-- otherwise, call an error reporting element --> Rollback failed.<BR/> </ELSE> </IF>
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.