SQL*Plus User's Guide and Reference
Release 9.0.1

Part Number A88827-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Command Reference, 12 of 52


CHANGE

Syntax

C[HANGE] sepchar old [sepchar [new [sepchar]]]

Changes the first occurrence of the specified text on the current line in the buffer.

Terms

Refer to the following list for a description of each term or clause:

sepchar

old

new

Usage

CHANGE changes the first occurrence of the existing specified text on the current line of the buffer to the new specified text. The current line is marked with an asterisk (*) in the LIST output.

You can also use CHANGE to modify a line in the buffer that has generated an Oracle error. SQL*Plus sets the buffer's current line to the line containing the error so that you can make modifications.

To reenter an entire line, you can type the line number followed by the new contents of the line. If you specify a line number larger than the number of lines in the buffer and follow the number with text, SQL*Plus adds the text in a new line at the end of the buffer. If you specify zero ("0") for the line number and follow the zero with text, SQL*Plus inserts the line at the beginning of the buffer (that line becomes line 1).

Examples

Enter 3 so the current line of the buffer contains the following text:

Keyboard icon
3

Screen icon
  3* WHERE JOB_ID IS IN ('CLERK', 'SA_MAN')

Enter the following command:

Keyboard icon
CHANGE /CLERK/SH_CLERK/

The text in the buffer changes as follows:

Screen icon
  3*  WHERE JOB_ID IN ('SH_CLERK', 'SA_MAN')

Or enter the following command:

Keyboard icon
CHANGE /'CLERK',... /'SH_CLERK'/

The original line changes to

Screen icon
  3* WHERE JOB_ID IS IN ('SH_CLERK')

Or enter the following command:

Keyboard icon
CHANGE /(...)/('SA_MAN')/

The original line changes to

Screen icon
  3* WHERE JOB_ID IS IN ('SA_MAN')

You can replace the contents of an entire line using the line number. This entry

Keyboard icon
3  WHERE JOB_ID IS IN ('SH_CLERK')

causes the second line of the buffer to be replaced with

WHERE JOB_ID IS IN ('SH_CLERK')

Note that entering a line number followed by a string will replace the line regardless of what text follows the line number. For example,

Keyboard icon
2  CHANGE/OLD/NEW/

will change the second line of the buffer to be

Screen icon
  2* C/OLD/NEW/

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback