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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-13
Logical Names for SQL/MP Objects
You can choose to use physical names to refer to SQL/MP tables and views by setting
the NAMETYPE attribute to NSK. If the NAMETYPE is NSK, NonStop SQL/MX
automatically qualifies a physical table or view name with the current default node,
volume, and subvolume names unless you explicitly specify these names with the
object name.
In SQL/MX releases earlier than SQL/MX Release 2.x, if NAMETYPE was NSK and
you did not use a correlation name, SQL/MX used the table part of the name as the
correlation name. This behavior was similar to that of NonStop SQL/MP. In SQL/MX
Release 2.x, if you do not use a correlation name, SQL/MX uses the default volume
and subvolume to qualify the name. If the file does not exist, NonStop SQL/MX returns
an error, which is ANSI-compliant behavior.
For more information about the default node, volume and subvolume names, and the
NAMETYPE attribute, see Object Naming on page 10-48.
Logical Names for SQL/MP Objects
You can refer to an SQL/MP table or view by using the three-part logical name of an
SQL/MP alias:
catalog-name.schema-name.object-name
In this three-part name, catalog-name is the name of the catalog, schema-name is
the name of the schema, and object-name is the simple name of the table or view.
Each of the parts is an SQL identifier. See Identifiers on page 6-52. The NAMETYPE
attribute defaults to ANSI, allowing you to use logical names of SQL/MP aliases for
SQL/MP objects.
NonStop SQL/MX automatically qualifies an object name with the current default
catalog and schema name unless you explicitly specify catalog and schema names
with the object name. A two-part name schema-name.object-name is qualified
implicitly with the current default catalog. A one-part name object-name is qualified
implicitly with the default schema and catalog.
If the NAMETYPE is ANSI, you can qualify a column name in an SQL/MX statement by
using a three-part, two-part, or one-part object name, or a correlation name.
For more information about the default catalog and schema, and the NAMETYPE
attribute, see Object Naming on page 10-48. For more information on assigning logical
names to SQL/MP tables or views, see SQL/MP Aliases on page 6-105.
DEFINE Names for SQL/MP Objects
You can use DEFINE names as logical names for SQL/MP tables, views, or partitions
in DML statements. When NonStop SQL/MX compiles such statements, it replaces the
DEFINE name in the statement with the associated Guardian physical name. DEFINE
names can be created within MXCI or can be inherited from the TACL process or the
OSS shell.