Accept

Transformation for this command is pending

Description

Reads a line of input and stores it in a given substitution variable.. (Oracle SQL Plus User's Guide and Reference)

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

Snowflake does not have a direct equivalent to this command. In order to emulate this functionality, the SnowCLI!system command will be used by taking advantage of the system resources for the input operations.

1. Accept command

Oracle

ACCEPT variable_name CHAR PROMPT 'Enter the variable value >'

SnowSQL (CLI Client)

!print Enter the value
!system read aux && echo '!define variable_name='"$aux" > sc_aux_file.sql 
!load sc_aux_file.sql
!system rm sc_aux_file.sql

Note that this approach only applies to MacOs and Linux. If you want to run these queries in Windows you may need a terminal that supports a Linux bash script language.

Known Issues

No Known Issues.

No related EWIs.

Last updated