Purpose
You can execute this statement to switch catalogs.
Note
For OceanBase Database V4.3.5, the SET CATALOG statement is supported starting from V4.3.5 BP2.
Privilege requirements
To execute the SET CATALOG statement, the current user must have the USE CATALOG privilege. For more information about the privileges in OceanBase Database, see Privilege types in MySQL-compatible mode.
Syntax
SET CATALOG {INTERNAL | external_catalog_name};
Parameters
| Parameter | Description |
|---|---|
| INTERNAL | Indicates switching to the system's internal catalog. |
| external_catalog_name | The name of the external catalog to switch to. |
Note
You can run the use internal.test or use odps_catalog.default statement to switch catalogs and databases at the same time.
Examples
Switch to the external data catalog named
test_odps_catalog.SET CATALOG test_odps_catalog;Switch to the internal catalog.
SET CATALOG INTERNAL;