SQL/MX Programming Manual for Java

SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java523726-003
4-22
Precedence of Object Name Qualification
name resolution. For more information, see Compile-Time Name Resolution for
SQL/MP Objects on page 4-23.
The use of DEFINEs in SQL statements also enables late name resolution. By using
late name resolution, you can customize a statement to use one table and then,
without recustomizing the statement, process a different table when the statement is
executed by using a different value for the statement’s DEFINE. For more information,
see Late Name Resolution for SQL/MP Objects on page 4-23.
For the syntax of DEFINEs, see the SQL/MX Reference Manual. To use a DEFINE for
a table or view, map it to a Guardian physical file before you customize or execute the
program. See information about how to ensure proper name resolution in the SQL/MX
Installation and Management Guide.
OLT Optimization Considerations for DEFINE Names
If you use DEFINE names in a statement that is optimized for online transaction (OLT)
processing, the resulting plan uses OLT optimization in these paths only:
PARTITION_ACCESS operator
DP2 operators
An OLT optimized plan does not use OLT optimization in the ROOT operator if you use
DEFINE names in the statement. For information about OLT optimization, see the
SQL/MX Query Guide.
Precedence of Object Name Qualification
If the object names in an SQL statement are unqualified or partially qualified, the
customizer determines the qualification—the catalog and schema (or the node,
volume, and subvolume)—of the object names based on these settings in order of
precedence, from highest to lowest:
1. DECLARE, SET, or CONTROL QUERY DEFAULT statements in the SQLJ source
file
2. SQLJ command-line options to the translator or customizer on the Java command
line or in a properties file:
°
-nametype
°
-catalog (ANSI logical names only)
°
-schema (ANSI logical names only)
°
-mploc (Guardian physical names only)
3. Default NAMETYPE, CATALOG, SCHEMA, MP_SYSTEM, MP_VOLUME, or
MP_SUBVOLUME specified in the SYSTEM_DEFAULTS table
4. User group (catalog) and user name (schema) of the current user if the nametype
is ANSI (the default), or the default node, volume, and subvolume specified by the
_DEFAULTS DEFINE if the nametype is NSK