April 2000
Intermediate to advanced
94 pages
1h 52m
English
ACCEPT
ACC[EPT] user_variable [NUM[BER] | CHAR | DATE] [FOR[MAT] format_specification] [DEF[AULT] default_value] [PROMPT prompt_text | NOPR[OMPT]] [HIDE]
The ACCEPT command is used to get input from a user. For example:
ACCEPT user_password CHAR - PROMPT "Password: " HIDE ACCEPT id NUMBER FORMAT "999.99" ACCEPT report_date DATE - PROMPT "Date: " FORMAT "dd-mon-yyyy"
Is the name of the variable that you want to define.
Is the type of data you are after.
Is a format specification, which may be optionally enclosed in quotes.
Specifies a default value to assign to the variable.
Is the prompt text displayed to the user.
Indicates that you do not want the user to see a visible prompt.
Causes SQL*Plus not to echo the user’s response back to the display. This is useful if you are prompting for a password.
The syntax for the ACCEPT command has evolved significantly with the past few releases of SQL*Plus. The syntax shown here is valid for version 8.1. Not all of the clauses are available when using prior versions.