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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-72
Considerations for CREATE SQLMP ALIAS
Late Bind
If you compile an application that uses an SQL/MP alias and later you change the
SQL/MP alias to map to a different SQL/MP table, the SQL/MP table definition is no
longer compatible with the definition used at compile time. As a result, you must
manually recompile applications that use the alias. If the late bind does not find the
SQL/MP table underlying the SQL/MP alias or if the SQL/MP table was moved,
NonStop SQL/MX returns an error.
For more information, see the SQL/MX Programming Manual for C and COBOL.
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 more information on embedding
SQL in programs, see the SQL/MX Programming Manual for C and COBOL.
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 statement
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
Embed