SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Migrating SQL/MX Release 1.8 Applications to
SQL/MX Release 2.x
HP NonStop SQL/MX Database and Application Migration Guide540435-005
7-7
SQL/MX Release 1.8 Applications in a Distributed
Database Environment
You can eliminate these risks by updating the source code of an SQL/MX Release 1.8
application and language-compiling the application in SQL/MX Release 2.x. Ensure
that the host variables for all KANJI and KSC5601 characters specify the correct
lengths for SQL/MX Release 2.x, and use C string functions that are valid for double
byte-encoded character sets.
SQL/MX Release 1.8 Applications in a
Distributed Database Environment
An SQL/MX Release 1.8 application on an SQL/MX Release 2.x node cannot query
SQL/MP tables on SQL/MX Release 1.8 nodes because SQL/MX Release 1.8 and
SQL/MX Release 2.x nodes are not interoperable. An SQL/MX Release 1.8 application
on an SQL/MX Release 2.x node can query SQL/MP tables on Release 2.x nodes
only. You must upgrade remote SQL/MX Release 1.8 nodes to SQL/MX Release 2.2,
2.1, or 2.0 for SQL/MX applications on an SQL/MX Release 2.x node to access
SQL/MP tables on those nodes.
Recompiling SQL/MX Release 1.8 Applications
in SQL/MX Release 2.x
To take advantage of performance improvements in SQL/MX Release 2.x, recompile
the modules of embedded SQL/MX Release 1.8 applications after migrating the
system to SQL/MX Release 2.x. Recompiling modules in a new database environment
ensures that you have optimal query execution plans and helps prevent automatic
recompilation from occurring. For more information about compiling embedded
SQL/MX applications, see the
SQL/MX Programming Manual for C and COBOL.
Changes to Query Optimization and Statistics
in SQL/MX Release 2.x
SQL/MX Release 2.x provides significant improvements in query optimization and
statistics, which affect query-plan traversal. For the same queries, the SQL/MX
Release 2.x optimizer might traverse different plans in the search space compared to
SQL/MX Release 1.8.
Rarely, some SQL/MX Release 1.8 plans might not be achieved in SQL/MX Release
2.x. Because of changes in the query optimizer and UPDATE STATISTICS introduced
with SQL/MX Release 2.0, CONTROL QUERY SHAPE statements written for SQL/MX
Release 1.8 might not work in an SQL/MX 2.x environment. If plans were forced by the
CONTROL QUERY SHAPE statement, queries that used to compile with this
statement might fail to compile in SQL/MX Release 2.x.