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, 28 of 52


INPUT

Syntax

I[NPUT] [text]

Adds one or more new lines of text after the current line in the buffer.

Terms

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

text

To add several lines, enter INPUT with no text. INPUT prompts you for each line. To leave INPUT, enter a null (empty) line or a period.

Usage

If you enter a line number at the command prompt 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, then SQL*Plus inserts the line at the beginning of the buffer (that line becomes line 1).

Examples

Assume the SQL buffer contains the following command:

Keyboard icon
SELECT LAST_NAME, DEPARTMENT_ID, SALARY, COMMISSION_PCT
FROM EMP_DETAILS_VIEW

To add an ORDER BY clause to the query, enter

Keyboard icon
LIST 2

Screen icon
  2* FROM EMP_DETAILS_VIEW

Keyboard icon
INPUT ORDER BY LAST_NAME

LIST 2 ensures that line 2 is the current line. INPUT adds a new line containing the ORDER BY clause after the current line. The SQL buffer now contains the following lines:

Screen icon
1  SELECT LAST_NAME, DEPARTMENT_ID, SALARY, COMMISSION_PCT
2  FROM  EMP_DETAILS_VIEW
3* ORDER BY LAST_NAME

To add a two-line WHERE clause, enter

Keyboard icon
LIST 2

Screen icon
  2* FROM EMP_DETAILS_VIEW

Keyboard icon
INPUT
  3  WHERE JOB_ID = 'SA_MAN'
  4  AND COMMISSION_PCT=.25
  5

INPUT prompts you for new lines until you enter an empty line or a period. The SQL buffer now contains the following lines:

Screen icon
SELECT LAST_NAME, DEPARTMENT_ID, SALARY, COMMISSION_PCT
FROM EMP_DETAILS_VIEW
WHERE JOB_ID = 'SA_MAN'
AND COMMISSION_PCT = .25
ORDER BY LAST_NAME

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