Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

REDO

The REDO command re-executes a statement that you entered earlier in your session. The statement is retrieved from the command log, which is a list of up to 256 statements that you have entered most recently during the current session. REDO enables you to changes in the statement before it is re-executed.

Syntax

REDO [number|index] 'original' 'replacement' [specifier

Arguments

number

A positive integer that indicates the number of the statement to be re-executed. You can display the statements, with their numbers, using the RECAP command.

index

A negative integer or zero that indicates the position of the statement to be re-executed relative to the end of the command log. The most recent statement is 0, the one before that is -1, and so on. The default is 0.

original

A text literal that is part of the statement to be re-executed.

replacement

A text literal that should replace original when the statement is re-executed.

specifier

One of the specifiers listed in Table 20-3, "Valid Values for REDO specifier". Each specifier indicates where text replacement should occur in the re-executed statement.

Table 20-3 Valid Values for REDO specifier

Specifier Meaning
FIRST Indicates that only the first occurrence of original should be changed to replacement.
LAST Indicates that only the last occurrence of original should be changed to replacement.
n A number indicating which occurrence of original should be changed to replacement. For example, 3 indicates the third occurrence.
ALL Indicates that all occurrences of original should be changed to replacement
*
Indicates that all occurrences of original should be changed to replacement.

The default is ALL. When you do not provide a specifier, all occurrences of original will be changed to replacement.

Notes


REDO with No Argument

When you type REDO without an argument, the most recent statement will be re-executed.


Command Log

The command log is a list maintained internally by Oracle OLAP. It contains the statements executed most recently in your session. The maximum number of statements in the command log is 256. When you start a new session, the list is empty.


REDO and REEDIT

The REEDIT command is similar to REDO, except that the statement is not executed after you edit it. It is placed in the command log so that you can edit it again.


Statements Not in the Command Log

RECAP, REDO, and REEDIT commands are not included in the command log. But the statements re-executed by REDO and re-edited by REEDIT are included.


Case-Sensitivity

When matching original with the text of the statement to be re-executed, REDO ignores case differences. For example, assume you specify AT as original, REDO will match it with at, At, aT, or AT in the statement.

When replacing original with replacement, REDO retains the case of all characters in replacement. For example, assume you specify ShOw as replacement, that is exactly how it will appear in the re-executed statement.

Examples

Example 20-6 Redoing a Report

The following output is the result of recap 2 statement.

COMMAND LOG
6: fetch w 20 down division total(actual)
7: listnames

The following REDO statement re-executes the FETCH statement with a different variable.

REDO 6 'actual' 'budget'