Oracle® OLAP DML Reference 11g Release 1 (11.1) Part Number B28126-01 |
|
|
View PDF |
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.Syntax
REEDIT [number|index] 'original' 'replacement' [specifier]
Arguments
A positive INTEGER
that indicates the number of the statement to be edited. You can display the statements, with their numbers, using a RECAP statement.
A negative INTEGER
or 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 0
.
A text literal that is part of the statement to be edited.
A text literal that should replace original when the statement is edited.
One of the specifiers 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
Specifier | Meaning |
---|---|
|
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. |
n |
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 will be changed to replacement.
Notes
REEDIT with No number or index Argument
When you type REEDIT without number or index, the most recent statement will be edited.
Case-Sensitivity
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 will match it with at
, At
, aT
, or 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 will appear in the edited statement.
Examples
Example 10-91 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
The statement
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
The statement
REEDIT 7 '15' '18'
produces the following output.
8: limit mydim to 2 to 10 , 18 to 20, 24 to 28, 33 to 40
The statement
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