An alternative way to edit the SQL*Plus buffer is to use the text editor within your operating system. The exact editor used depends on which operating system you are using. For example, if you are using Windows, the editor invoked is Microsoft Notepad or download Notepad++.
Invoke the editor by typing the following command and pressing Enter.
When the editor is invoked, SQL*Plus creates a file named AFIEDT.BUF and writes the SQL*Plus buffer into the file. After making changes, when you are saving and closing the file, SQL*Plus copies the modified file back into the SQL*Plus buffer and prints it on the screen. Go through the following Slide Show for a quick demonstration of invoking and using the text editor.
First, some comments on style. SQL*Plus does not care whether the SQL commands you type are in uppercase or lowercase.For example, the command
SeLeCt feaTURE, section, PAGE FROM newsPaPeR;
will produce exactly the same result as this one:
select Feature, Section, Page from NEWSPAPER;
Case matters only when SQL*Plus or Oracle is checking an alphanumeric value for equality. Aside from this usage, case is completely irrelevant. As a matter of style, this module follows certain conventions about case to make the text easier to read:
select, from, where, order by, having, and group by will always be lowercase and boldface in the body of the text.
SQL*Plus commands also will be lowercase and boldface (for example, column, set, save, ttitle, and so on).
IN, BETWEEN, UPPER, and other SQL operators and functions will be uppercase and boldface.
Column names will be mixed uppercase and lowercase without boldface (for example, Feature, EastWest, Longitude, and so on).
Table names will be uppercase without boldface (for example, NEWSPAPER, WEATHER, LOCATION, and so on).
You may want to follow similar conventions in creating your own queries, or your company already may have standards it would like you to use. The goal of any such standards should always be to make your work simple to read and understand.
The link below contains information with respect to editing commands for saving and retrieving your own files in SQL*Plus.
Using Line Text Editors