Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-07
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
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

REEDIT

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

Parameters

number

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.

index

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.

original

A text literal that is part of the statement to be edited.

replacement

A text literal that should replace original when the statement is edited.

specifier

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

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 are changed to replacement.

Usage Notes

REEDIT with No number or index Argument

When you type REEDIT without number or index, the most recent statement is 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 matches 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 appears in the edited statement.

Examples

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

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