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_NUM
are:
- "
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
ROLLBACK
tag reverts a row in a tracked table to a previous revision. The current user must have the row locked and havertaudit
privileges 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
errno
include:
Value Description -1000 Command failure. Check theerrdetail
variable for the specific error.Example
This example assumes all
ROLLBACK
parameters 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 --> <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> <!-- clear out errno --> <SETVAR
NAME="errno" VALUE="0"/> <!-- do the rollback --> <ROLLBACK TABLE="Variables.tablename" ASSET="Variables.asset" VERSION="Variables.version"/> <!-- see if the rollback succeeded --> <IF
COND="Variables.errno=0"> <THEN> <!-- if succeeded, note it--> Rollback succeeded for <CSVAR
NAME="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, 2018, Oracle and/or its affiliates. All rights reserved.