DESCRIBE VARIABLE¶
Describes a schema variable, including its type, current value, default, and metadata.
DESCRIBE can be abbreviated to DESC.
Syntax¶
Parameters¶
nameSpecifies the identifier for the variable to describe. The identifier can be qualified with the schema name or with both the database and schema names.
Output¶
The command returns the following columns:
| Column | Data Type | Description |
|---|---|---|
| name | VARCHAR | Name of the variable |
| data_type | VARCHAR | Declared data type of the variable |
| value | VARCHAR | Current value, or NULL if not set |
| default_value | VARCHAR | Default value, or NULL if no default was declared |
| version | NUMBER | Current version number; incremented on each SET |
| owner | VARCHAR | Role that owns the variable |
| comment | VARCHAR | Comment for the variable |
| created_on | TIMESTAMP_LTZ | Date and time when the variable was created |
| updated_on | TIMESTAMP_LTZ | Date and time when the variable was last modified |
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| OWNERSHIP, READ, or WRITE | Variable | Any one of these privileges is sufficient. |
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
-
To post-process the output of this command, you can use the pipe operator (
->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.