USE Statement
Specifies the SCHEMA and compute resource for the current session.
Syntax
Parameters
SCHEMA: This is an optional keyword and can be omitted from the statement.schema_name: Specifies the name of the schema to switch to.
Examples
-
Switch to the schema named
ods_schema: -
Suppose the current workspace has a compute cluster named
sample_vc. You can switch to this compute cluster using the following command: -
To switch to a compute cluster named
high_performance_vc, execute the following command:
Usage Notes
- When connecting using client tools such as SQLLine Client or DBeaver, the relevant operations take effect for the entire session duration.
- If you are using the Lakehouse Studio interface, it is recommended to switch schemas and compute clusters primarily through the page UI. If you use the command directly, its effect is only temporary, and you must select and execute it together with the SQL statements that depend on it for it to take effect.
