Define
Last updated
Last updated
Transformation for this command is pending
The
DEFINE
command specifies a user or predefined variable and assigns a CHAR value to it, or lists the value and variable type of a single variable or all variables. ()
This case is functionally equivalent.
The DEFINE
command is replaced by the command.
For referring to a previously defined variable, & is preceded by the name of the variable, if the variable does not exist, Oracle allows its execution time assignment, however, Snowflake would throw an error indicating the non-existence of said variable
This case is not functionally equivalent.
The DEFINE command used without the assignment statement is used in Oracle to show the definition of the variable, on the other hand in Snowflake this way of using the DEFINE command would reset the assignment of the variable, so a way to simulate the behavior presented in Oracle it is by using the SELECT command.
This solution would be something like this:
1. Enabling variable substitution
To enable SnowSQL CLI to substitute values for the variables, you must set the variable_substitution configuration option to true. This process can be done at installation, when starting a database instance, or by running the following command:
2. Predefined variables
There are nine predefined variables during SQL*Plus installation. These variables can be used later by the user. The SnowSQL CLI client only has two predefined variables __ROWCOUNT
and __SFQID
.