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


ACCEPT

Syntax

ACC[EPT] variable [NUM[BER]|CHAR|DATE] [FOR[MAT] format] [DEF[AULT] default]
[PROMPT text|NOPR[OMPT]] [HIDE]

Reads a line of input and stores it in a given user variable.

Terms

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

variable

NUM[BER]

CHAR

DATE

FOR[MAT]

DEF[AULT]

PROMPT text

NOPR[OMPT]

HIDE

To display or reference variables, use the DEFINE command. See the DEFINE command in this chapter for more information.

Examples

To display the prompt "Password: ", place the reply in a CHAR variable named PSWD, and suppress the display, enter

Keyboard icon
ACCEPT pswd CHAR PROMPT 'Password:  ' HIDE

To display the prompt "Enter weekly salary: " and place the reply in a NUMBER variable named SALARY with a default of 000.0, enter

Keyboard icon
ACCEPT salary NUMBER FORMAT '999.99' DEFAULT '000.0' -
PROMPT 'Enter weekly salary:  '

To display the prompt "Enter date hired: " and place the reply in a DATE variable named HIRED with the format "dd/mm/yyyy" and a default of "01/01/2001", enter

Keyboard icon
ACCEPT hired DATE FORMAT 'dd/mm/yyyy' DEFAULT '01/01/2001'-
PROMPT 'Enter date hired:  '

To display the prompt "Enter employee lastname: " and place the reply in a CHAR variable named LASTNAME, enter

Keyboard icon
ACCEPT lastname CHAR FORMAT 'A20' -
PROMPT 'Enter employee lastname:  '

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