Changes the default catalog name to be used for schema, table, and column references. The default catalog name is initially the name of the primary database.
Syntax
SET CATALOG catalog_name;
Parameter
catalog_name
Catalog name to be used as an alias for the database in schema, table and column references. This must be in the form of an SQL identifier of up to 32 bytes in length.
Notes
The SET CATALOG statement is used to specify the default database catalog name to be used for schema, table, and column references.
The primary database connection is automatically given a catalog name which is the name of the primary database. For example, if the primary database is at /usr/progress/sports2000, then the catalog name for the primary database is sports2000.
The SET CATALOG statement may be used to set the default catalog to an auxiliary database catalog or to the primary database catalog.
The specified catalog must identify a current catalog name.
If an auxiliary database catalog is set as the default catalog, disconnecting from the auxiliary catalog will not change the name of the default catalog. Thus setting the default catalog to an auxiliary database may cause failures of statements when the default catalog is not set to an active catalog. In other words, shutting down an auxiliary database identified as the default catalog will cause any query using a three-part specification to fail. The failure produces an error indicating that the catalog is not connected.
Example
In this example, the auxiliary database connection identified by the catalog named mydb1 is specified as the default catalog: