SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-208
SET CATALOG Statement
SET CATALOG Statement
Considerations for SET CATALOG
MXCI Examples of SET CATALOG
C Example of SET CATALOG
COBOL Example of SET CATALOG
The SET CATALOG statement sets the default logical catalog for unqualified schema
names for the current SQL session.
The SET CATALOG statement sets the default catalog for unqualified schema names
in all dynamic statements within the control flow scope of an embedded SQL program
for the current SQL session.
default-catalog-name
specifies the name of the catalog. See Catalogs on page 6-2.
default-catalog-name is an SQL identifier. For example, you can use
MYCATALOG or mycatalog or a delimited identifier "my catalog". See
Identifiers on page 6-52.
default-catalog-name is a value specification—a string literal or an SQL
identifier—that specifies the catalog name. Enclose a string literal in single
quotation marks ('); for example, 'mycatalog', where mycatalog is the name
you choose. See Character String Literals on page 6-60.
Considerations for SET CATALOG
Scope of SET CATALOG
The default catalog you specify with SET CATALOG remains in effect until the end of
the session or until you execute another SET CATALOG statement (or an equivalent
SET SCHEMA statement).
If no SET CATALOG statement is in effect, NonStop SQL/MX determines the default
catalog. For more information, see Object Naming on page 10-48.
Use SET CATALOG to set a new default catalog for dynamic SQL statements. Use
DECLARE CATALOG to set a new default catalog for static SQL statements. See
DECLARE CATALOG Declaration on page 3-21. For more information, see the
SQL/MX Programming Manual for C and COBOL.
MXCI Examples of SET CATALOG
Set the default catalog name:
SET CATALOG mycatalog;
SET CATALOG default-catalog-name
Embed
MXCI
Embed
Embed