SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

LIST

Purpose

Lists one or more lines of the SQL buffer.

Syntax

L[IST] [n|n m|n *|n LAST|*|* n|* LAST|LAST]

Terms and Clauses

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

n Lists line n.
n m Lists lines n through m.
n * Lists line n through the current line.
n LAST Lists line n through the last line.
* Lists the current line.
* n Lists the current line through line n.
* LAST Lists the current line through the last line.
LAST Lists the last line.
Enter LIST with no clauses to list all lines.

Usage Notes

The last line listed becomes the new current line (marked by an asterisk).

Example

To list the contents of the buffer, enter

SQL> LIST

You will see a listing of all lines in the buffer, similar in form to the following example:

  1  SELECT ENAME, DEPTNO, JOB
  2  FROM EMP
  3  WHERE JOB = 'CLERK'
  4* ORDER BY DEPTNO

The asterisk indicates that line 4 is the current line.

To list the second line only, enter

SQL> LIST 2

You will then see this:

  2* FROM EMP

To list the current line (now line 2) to the last line, enter

SQL> LIST * LAST

You will then see this:

  2  FROM EMP
  3  WHERE JOB = 'CLERK'
  4* ORDER BY DEPTNO


Contents Index Home Previous Next