SET CATALOG
Use the SET CATALOG command to connect to a different database in the same session. You cannot use this command inside an explicit transaction (BEGIN/COMMIT pair), or inside the body of a stored procedure.
Syntax
Syntax for connecting to a different
database.
SET CATALOG <database_name>Inputs
The SET CATALOG command takes the following inputs:
| Input | Description |
|---|---|
| <database_name> | The database to which you want to connect. |
Output
The SET CATALOG command has the following output:
| Output | Description |
|---|---|
| SET CATALOG | The command was successful. |
| ERROR: SET CATALOG: object <name> does not exist. | The database does not exist. |
Privileges
You must be the admin user, the database owner, or your account must have List privileges on the database or the Database object class.
Usage
The following provides sample usage.
MYDB.SCH1(USER)=> SET CATALOG db1;
SET CATALOG
DB1.SCHEMA(USER)=>