Purpose
This statement is used to switch the catalog.
Privilege requirements
To execute the SET CATALOG statement, the current user must have the USE CATALOG privilege. For more information about OceanBase Database privileges, see Privilege classification in MySQL-compatible mode.
Syntax
SET CATALOG {INTERNAL | external_catalog_name};
Parameters
| Parameter | Description |
|---|---|
| INTERNAL | Switches to the internal catalog. |
| external_catalog_name | Specifies the name of the external data catalog to switch to. |
Note
You can use use internal.test or use odps_catalog.default to switch the catalog and database at the same time.
Examples
Switch to the external data catalog
test_odps_catalog.SET CATALOG test_odps_catalog;Switch to the internal catalog.
SET CATALOG INTERNAL;