SQL/MP to SQL/MX Database and Application Migration Guide

Converting SQL/MP Applications to SQL/MX
Applications
HP NonStop SQL/MP to NonStop SQL/MX Database and Application Migration Guide666211-001
4-55
Similarity Checks and Automatic Recompilation of
Embedded SQL/MX Applications
execute embedded SQL/MX applications in the Guardian environment. For more
information, see the
SQL/MX Programming Manual for C and COBOL.
If you plan to move to the OSS environment when converting your SQL/MP
applications to SQL/MX applications, you might need to convert the TACL macros that
compile applications to OSS shell scripts. For more information about migrating
Guardian applications to OSS, see the
Open Systems Services Porting Guide.
Similarity Checks and Automatic Recompilation of Embedded
SQL/MX Applications
If you convert an embedded SQL/MP application to NonStop SQL/MX, be aware of the
differences in how NonStop SQL/MP and NonStop SQL/MX handle similarity checks
and automatic recompilation of the compiled query execution plans.
Program Invalidation
NonStop SQL/MX checks validity on a statement basis and does not mark executables
invalid as NonStop SQL/MP does. In NonStop SQL/MX, if a statement plan becomes
invalid because of a DDL operation, the similarity check fails, and automatic
recompilation of the invalid statement occurs at run time. The recompiled statement
plan is saved in memory and used for the duration of the application executable.
Automatic Recompilation Warnings
NonStop SQL/MP returns a warning to the application if a similarity check fails and
automatic recompilation occurs. Because NonStop SQL/MX is ANSI-compliant, an
automatic recompilation warning is not returned to the application by default. To obtain
the same behavior as in NonStop SQL/MP, set the RECOMPILATION_WARNINGS
default attribute to ON.
Causes of Similarity Check Failure
Unlike NonStop SQL/MP, which determines the indexes to update at run time, index
maintenance in NonStop SQL/MX is part of the query execution plan that is created at
compile time. Creating or dropping an index invalidates all SQL/MX plans that insert,
update, or delete data in a SQL/MX or SQL/MP table.
Check constraints, referential integrity (RI) constraints, and triggers are also part of the
compiled plan. A similarity check always fails when invoked if a constraint or trigger
exists on a SQL/MX or SQL/MP table.
Table 4-15
summarizes the outcome of similarity checks in NonStop SQL/MP and
NonStop SQL/MX when similarity check is on at compilation.