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

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