SQL/MX Programming Manual for Java
SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java—523726-003
4-20
Name Resolution
Name Resolution
In an SQLJ program, you can use SQL/MX statements to query both SQL/MP and
SQL/MX database objects. This subsection explains how to refer to SQL/MP and
SQL/MX database objects in an SQLJ source file and how the object names are
resolved during customization and SQLJ run time. See these topics:
•
Table and View Name References on page 4-20
•
Precedence of Object Name Qualification on page 4-22
•
Compile-Time Name Resolution for SQL/MP Objects on page 4-23
•
Late Name Resolution for SQL/MP Objects on page 4-23
•
Distributed Database Considerations on page 4-24
•
RDF Considerations on page 4-24
Table and View Name References
When you write a static SQL statement in an SQLJ program, you have several choices
of how to refer to tables or views:
•
ANSI Names for SQL/MX Objects on page 4-20
•
Guardian Names for SQL/MP Objects on page 4-21
•
SQL/MP Aliases for SQL/MP Objects on page 4-21
•
DEFINE Names for SQL/MP Objects on page 4-21
You can fully or partially qualify ANSI logical names, Guardian physical names, and
SQL/MP aliases. For more information, see Precedence of Object Name Qualification
on page 4-22.
Your choice of how to refer to a table or view directly influences how tightly a physical
table is bound to a table or view name in the SQL statement during customization.
ANSI Names for SQL/MX Objects
You can use only an ANSI logical name for SQL/MX tables or views in an SQL
statement:
#sql {DELETE FROM samdbcat.persnl.employee};
When you hard code a table name in the ANSI logical format, the logical name is
tightly bound to a physical table when the SQL statement is customized. To make the
statement refer to some other physical table, you must edit the source code,
recustomize the profile, and recompile the module.
For the syntax of this type of database object name, see the SQL/MX Reference
Manual.