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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual523725-004
2-73
Considerations for CREATE SQLMP ALIAS
Embedding the Statement in an SQL Program
If you embed a CREATE SQLMP ALIAS statement in a static SQL program,
subsequent references in the same program to the SQL/MP alias cause compilation
errors because the alias does not reside in the OBJECTS table. To avoid these errors,
create logical name mappings separately before compiling static SQL programs that
refer to the SQL/MP alias. Compilation errors do not occur when you create and refer
to SQL/MP aliases in a dynamic SQL program. For information on embedding SQL in
programs, see the SQL/MX Programming Manual for C and COBOL or the SQL/MX
Programming Manual for Java.
Partitioned Tables
Use the CREATE SQLMP ALIAS statement to create logical mappings for different
partitions of a table. That is, two partitions of the same table can be referenced with
different ANSI names. However, HP recommends that you map an alias to the primary
partition for accessing the entire partitioned table.
Aliases can be visible to a remote node through a REGISTER CATALOG command
Security of Alias
To create, alter, or drop aliases, you must be the owner of the schema or be the super
ID.
Comparison with Previous Versions
In SQL/MX releases earlier than SQL/MX Release 2.x, an SQLMP alias name was a
logical name in which the parts catalog and schema did not denote ANSI-defined
catalog and schema but only the first and second parts of the logical name. The name
had a maximum length of 200 characters. Information about aliases was kept in the
MPALIAS table in the SQLMP system catalog for all aliases in the local node. Any user
could create or drop aliases.
In SQL/MX Release 2.x and subsequent releases, a three-part SQLMP alias name
must contain catalog and schema names that represent actual SQL/MX ANSI catalogs
and schemas. The object name for an SQLMP alias identifies an object (in the
OBJECTS table of the definition schema for that catalog) whose OBJECT_TYPE is
“MP for an SQL/MP table, “PV” for an SQL/MP protection view, and “SV” for an
SQL/MP shorthand view and whose OBJECT_UID points to an entry in the
MP_PARTITIONS table in the same definition schema. (See MP_PARTITIONS Table
on page 10-18. The MPALIAS table which SQL/MX Release 1.8 and earlier versions
created in the SQL/MP catalog is no longer used. Instead, the alias information for
each schema is kept in the SQL/MX metadata for that schema.
Embed