|Oracle® OLAP DML Reference
11g Release 2 (11.2)
Part Number E17122-05
The REEDIT command edits 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. REEDIT enables you to change the statement without executing it, so you can edit it sequentially.
The REDO command is similar to REEDIT, except that the statement is executed after you edit it.
Note:REEDIT statements themselves are not included in the command log; however the statements re-executed by REEDIT are included.
REEDIT [number|index] 'original' 'replacement' [specifier]
INTEGER that indicates the number of the statement to be edited. You can display the statements, with their numbers, using a RECAP statement.
0 (zero) that indicates the position of the statement to be edited 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
A text literal that is part of the statement to be edited.
A text literal that should replace original when the statement is edited.
A specifier listed in Table 10-3, "Valid Values for REEDIT specifier". Each specifier indicates where text replacement should occur in the edited statement.
Table 10-3 Valid Values for REEDIT specifier
Indicates that only the first occurrence of original should be changed to replacement.
Indicates that only the last occurrence of original should be changed to replacement.
A number indicating which occurrence of original should be changed to replacement. For example,
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 are changed to replacement.
REEDIT with No number or index Argument
When you type REEDIT without number or index, the most recent statement is edited.
When matching original with the text of the statement to be edited, REEDIT ignores case differences. For example, assume you specify
AT as original, REEDIT matches it with
AT in the statement.
When replacing original with replacement, REEDIT retains the case of all characters in replacement. For example, assume you specify
ShOw as replacement, that is exactly how it appears in the edited statement.
Example 10-90 Editing Multiple Values in a LIMIT Command
The following example illustrates why it could be helpful to use a REEDIT statement to edit a statement several times before executing it. With REEDIT commands, you can edit multiple values in a LIMIT command before executing it. When you enter a REDO statement, the LIMIT command is executed.
The following output is the result of a
recap 1 statement.
COMMAND LOG 6: limit mydim to 1 to 10, 15 to 20, 24 to 28, 33 to 40
REEDIT 6 '1' '2' FIRST
produces the following output.
7: limit mydim to 2 to 10 , 15 to 20, 24 to 28, 33 to 40
REEDIT 7 '15' '18'
produces the following output.
8: limit mydim to 2 to 10 , 18 to 20, 24 to 28, 33 to 40
REDO 8 '40' '41'
makes one more change and re-executes the LIMIT command with the new values. It also produces the following output.
9: limit mydim to 2 to 10 , 18 to 20, 24 to 28, 33 to 41