Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
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.
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 the RECAP command.
A negative integer (or 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 20-4, "Valid Values for REEDIT specifier". Each specifier indicates where text replacement should occur in the edited statement.
Table 20-4 Valid Values for REEDIT 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
When you type REEDIT without number or index, the most recent statement will be edited.
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.
The REDO command is similar to REEDIT, except that the statement is executed after you edit it.
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.
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 20-7 Editing Multiple Values in a LIMIT Command
The following example illustrates why it could be helpful to use the REEDIT command 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 command, 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