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

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-15
Considerations for Database Object Names
You can use the CREATE SQLMP ALIAS command within your application to create
the needed mappings from logical to physical names. This command has the form:
CREATE SQLMP ALIAS catalog-name.schema-name.table-name
[\node.]$volume.subvol.filename
When this command is executed, a mapping is inserted as a row in the OBJECTS
table. SQL/MP aliases are simulated ANSI names that represent the underlying
Guardian physical names of SQL/MP objects. True ANSI names do not exist for
SQL/MP objects.
See DELETE Statement on page 2-109.
Mixing Name Types
In a single SQL statement, tables or views can use ANSI logical names or
Guardian physical names. You can combine these two name types in the same
DML statement. For example:
SELECT salary FROM samdbcat.persnl.employee
WHERE \mysys.$samdb.persnl.empnum IN
(SELECT mgr FROM \mysys.$samdb.persnl.dept);
INSERT INTO \mysys.$samdb.persnl.new_emps
(SELECT * FROM samdbcat.persnl.employee);
SET NAMETYPE ANSI;
SET SCHEMA samdbcat.sales;
UPDATE odetail
SET unit_price = unit_price * 10
WHERE partnum IN
(SELECT partnum FROM \mysys.$samdb.sales.parts);
You can use DEFINE names and ANSI logical names in the same DML statement:
SELECT * FROM =parts p, samdbcat.sales.odetail o
WHERE p.partnum = o.partnum;
You can use DEFINE names and Guardian physical names in the same DML
statement:
SELECT * FROM =parts p, \mysys.$samdb.sales.odetail o
WHERE p.partnum = o.partnum;
Default Name Types
If the table or view names are partial names, they are fully qualified according to the
rules of the current NAMETYPE attribute. The fully qualified names are either all ANSI
logical names or all Guardian physical names. For more information, see Object
Naming on page 10-48.