Skip to Main Content
Oracle SQL*Plus Pocket Reference
book

Oracle SQL*Plus Pocket Reference

by Jonathan Gennick
April 2000
Intermediate to advanced content levelIntermediate to advanced
94 pages
1h 52m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus Pocket Reference

Name

ACCEPT

Synopsis

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"

Parameters

user_variable

Is the name of the variable that you want to define.

NUM[BER] | CHAR | DATE

Is the type of data you are after.

FOR[MAT] format_specification

Is a format specification, which may be optionally enclosed in quotes.

DEF[AULT] default_value

Specifies a default value to assign to the variable.

PROMPT prompt_text

Is the prompt text displayed to the user.

NOPR[OMPT]

Indicates that you do not want the user to see a visible prompt.

HIDE

Causes SQL*Plus not to echo the user’s response back to the display. This is useful if you are prompting for a password.

Note

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle SQL*Plus Pocket Reference, 3rd Edition

Oracle SQL*Plus Pocket Reference, 3rd Edition

Jonathan Gennick
Expert Oracle Exadata

Expert Oracle Exadata

Kerry Osborne, Randy Johnson, Tanel Pöder

Publisher Resources

ISBN: 1565929411Catalog PageErrata