VARIABLES view¶
This Information Schema view displays a row for each schema variable defined in the specified (or current) database.
Columns¶
| Column Name | Data Type | Description |
|---|---|---|
| VARIABLE_CATALOG | VARCHAR | Database that the variable belongs to |
| VARIABLE_SCHEMA | VARCHAR | Schema that the variable belongs to |
| VARIABLE_NAME | VARCHAR | Name of the variable |
| VARIABLE_OWNER | VARCHAR | Name of the role that owns the variable |
| DATA_TYPE | VARCHAR | Declared data type of the variable |
| VALUE | VARCHAR | Current value of the variable, or NULL if no value has been set |
| DEFAULT_VALUE | VARCHAR | Default value of the variable, or NULL if no default was declared |
| VERSION | NUMBER | Monotonically increasing version number; incremented each time the variable is set |
| CREATED | TIMESTAMP_LTZ | Creation time of the variable |
| LAST_ALTERED | TIMESTAMP_LTZ | Date and time the variable was last altered. See Usage Notes. |
| COMMENT | VARCHAR | Comment for the variable |
Usage notes¶
- The view only displays variables for which the current role has been granted
OWNERSHIP,READ, orWRITEprivilege. The view does not honor the MANAGE GRANTS privilege and may show less information thanSHOW SCHEMA VARIABLES IN SCHEMAwhen executed by a user who holds the MANAGE GRANTS privilege. -
The LAST_ALTERED column is updated when the following operations are performed on an object:
- DDL operations.
- DML operations (for tables only). This column is updated even when no rows are affected by the DML statement.
- Background maintenance operations on metadata performed by Snowflake.