SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

Introduction
HP NonStop SQL/MX Reference Manual523725-004
1-24
Delimiting Reserved Words in Guardian Names
For the complete syntax and semantics, see CREATE SQLMP ALIAS Statement on
page 2-71.
To use ANSI names with the DDL Statements for the Sample Database on page D-3,
you must create an alias for each table that has been created.
For example, suppose that you have created the EMPLOYEE table with the physical
Guardian name $samdb.persnl.employee. To specify the logical name
samdbcat.persnl.employee for the employee table, enter:
CREATE SQLMP ALIAS samdbcat.persnl.employee
$samdb.persnl.employee;
DEFINE Names
NonStop SQL/MX supports the use of DEFINE names as logical names for tables,
views, or partitions in DML statements. When NonStop SQL/MX compiles such
statements, it replaces the DEFINE name (for example, =CUSTOMERS) 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.
For information about DEFINEs, see DEFINEs on page 6-36.
Delimiting Reserved Words in Guardian Names
In NonStop SQL/MP, you can use reserved words in Guardian names that identify
tables, views, partitions, and collations. NonStop SQL/MX has many more reserved
words than NonStop SQL/MP. If an SQL/MX reserved word occurs as part of a
Guardian name, you must delimit it by enclosing it in double quotes—that is, it must be
a delimited identifier. See Using SQL/MX Reserved Words in SQL/MP Names on
page 6-55.
For example, suppose that the location of the OBJECTS table is \nsk.$system.SQL.
To determine the physical name associated with a given logical SQL/MX object name,
you can query the OBJECTS table:
SELECT guardian_name
FROM \nsk.$system."SQL".objects
WHERE logical_name = 'samdbcat.persnl.employee';
In this example, "SQL" is written as a delimited identifier because SQL is a reserved
word in NonStop SQL/MX.