1 ACCEPT Prompts the user for additional information. This information is stored in an interactive SQL variable, which can subsequently be used by DML and some SET statements. 2 Environment You can use the ACCEPT statement in interactive SQL. 2 Format ACCEPT --> -+-+------------------------------+-+-> | +-> DEFAULT ---+ | | +-> HIDE ----------------------+ | | +-> PROMPT ---+ | | +-> NOPROMPT ------------------+ | | +-> TIMEOUT -+ | | +-> UPPER ---------------------+ | +-------------- <------------------+ variable-ref = --+-----+---> identifier -+--------------------------------+-> +> : -+ +-+-------------+-> : identifier + +> INDICATOR -+ 2 Arguments 3 DEFAULT_default-value Provides a default value to be used if the user presses the Return key. The default value must be a correctly formatted character string that can be converted to the data type of the variable. 3 HIDE Disables echo of the input text. The default is to echo all input characters. 3 PROMPT_string-literal Provides a prompt string that is displayed before accepting input. 3 NOPROMPT Disables prompting with a string. 3 TIMEOUT_numeric-literal If the user does not respond within this many seconds, then an error is returned. Negative or zero values of the numeric-literal are ignored. The default is to wait indefinitely. 3 UPPER All lowercase characters are converted to uppercase before assignment to the variable. The default is to leave lowercase characters unchanged. 3 variable-ref An interactive SQL variable defined using the DECLARE Variable statement. 2 Examples Example 1: Prompting Based on the PROMPT and NOPROMPT Clauses SQL> DECLARE :x INTEGER; SQL> DECLARE :y INTEGER; SQL> SQL> ACCEPT :x indicator :y PROMPT 'what value? '; what value? 10 SQL> PRINT :x, :y; X Y 10 0 SQL> SQL> ACCEPT :x INDICATOR :y NOPROMPT; 11 SQL> PRINT :x, :y; X Y 11 0 SQL> SQL> ACCEPT :x; Enter value for X: 12 SQL> PRINT :x; X 12 SQL> Example 2: Using ACCEPT to Prompt for SET FLAGS String This sequence would be included in a script. SQL> DECLARE :debug_flags CHAR(20); SQL> ACCEPT :debug_flags; Enter value for DEBUG_FLAGS: trace SQL> PRINT :debug_flags; DEBUG_FLAGS trace SQL> SET FLAGS :debug_flags; SQL> SHOW FLAGS Alias RDB$DBHANDLE: Flags currently set for Oracle Rdb: PREFIX,TRACE,MAX_RECURSION(100)