SQL * Plus Editing Commands

For editing  SQL Buffer,Use the SQL*Plus editing commands. You can make changes, delete lines, and add and list the buffer using these commands. Most editing commands operate on the current line. You can change the current line simply by typing the line number.

The following table  shows the editing commands in SQL*Plus.

Command Purpose Example
LIST

L

LIST m n

LIST LAST

Lists the contents of the

buffer. The asterisk indicates

the current line. The abbreviated

command for LIST is L.

LIST simply used or used with

* displays current line. LIST m

n displays lines from m

through n, if you substitute *

for m or n, it implies the current

line. LIST LAST displays

the last line.

SQL> L

1 SELECT EMPNO,

ENAME

2* FROM EMP

APPEND text

A text

Adds text to the end of the

last line.

SQL> A WHERE EMPNO

<> 7926

2* FROM EMP WHERE

EMPNO <> 7926

CHANGE /old/

new

C /old/new

Changes old to new. If you

omit new, old will be deleted.

SQL> C /<>/=

2* FROM EMP WHERE

EMPNO = 7926

INPUT text

I text

Adds a line of text. If text is

omitted, you can add as many

lines you wish.

SQL> I

3 7777 AND

4 EMPNO = 4354

5

SQL> I ORDER BY 1

SQL> L

1 SELECT EMPNO,

ENAME

2 FROM EMP WHERE

EMPNO =

3 7777 AND

4 EMPNO = 4354

5* ORDER BY 1

SQL>

DEL

DEL m n

DEL LAST

Deletes a line. DEL simply used

or used with * deletes current

line. DEL m n deletes lines

from m through n, if you substitute

* for m or n, it implies

the current line. DEL LAST

deletes the last line.

SQL> 3

3* 7777 AND

SQL> DEL

SQL> L

1 SELECT EMPNO,

ENAME

2 FROM EMP WHERE

EMPNO =

3 EMPNO = 4354

4* ORDER BY 1

SQL> DEL 3 *

SQL> L

1 SELECT EMPNO,

ENAME

2* FROM EMP WHERE

EMPNO =

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




CAPTCHA Image CAPTCHA Audio
Refresh Image

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .