USE WAREHOUSE¶
Specifies the active/current virtual warehouse for the session. You must specify a warehouse for a session, and the warehouse must be running before you can execute queries and DML statements in the session.
To view the current warehouse for a session, call the CURRENT_WAREHOUSE context function.
- See also:
Syntax¶
Parameters¶
nameSpecifies the identifier for the warehouse to use for the session. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
Examples¶
The following example specifies the warehouse where the current session performs its work:
The following example changes from one warehouse to another, then back to the original warehouse. The name of the original warehouse is stored in a variable. Run the following commands:
The output for these commands shows how the current warehouse value changes: