SQL Plus - ACCEPT command (Console Interaction)

Card Puncher Data Processing

About

The accept command reads a line of input and stores it in a given substitution variable.

Syntax

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

where:

  • variable is the variable command
  • prompt is the prompt command
  • HIDE will hide the input

Example

  • For a password
ACCEPT pwd CHAR PROMPT 'Type your Password:  ' HIDE
  • For a number
ACCEPT salary NUMBER FORMAT '999.99' DEFAULT '000.0' PROMPT 'Enter weekly salary:  '
PROMPT You have enter: &salary





Discover More
Card Puncher Data Processing
SQL Plus - Command Reference

Commands Description @ @@ / ACCEPT APPEND ARCHIVE ATTRIBUTE BREAK BTITLE CHANGE CLEAR COLUMN COMPUTE CONNECT COPY Copies data from a query to a table in the same or another...
Card Puncher Data Processing
SQL Plus - Flush System Variable

Flush is a system variable that controlswhen the output is sent to the user's display device. OFF is recommended when: you run a script that does not require user interaction and whose output...
Card Puncher Data Processing
SQL Plus - Substitution Variables

You can define variables, called substitution variables, for repeated use in a single script. Note that you can also define substitution variables to use in titles and to save your keystrokes (by defining...
Card Puncher Data Processing
SQL Plus - User Interaction

See



Share this page:
Follow us:
Task Runner