SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
15-59
Understanding and Avoiding Some Common Run-
Time Errors
For more information on the run or osh command, see the Open System Services
Shell and Utilities Reference Manual or the OSS reference pages.
Understanding and Avoiding Some Common Run-Time Errors
The details of how a C/C++ executable is linked with its module or modules are
handled by the system and take place in the background. However, by understanding
this process and why certain run-time errors occur, you can avoid some common
SQL/MX application development issues.
Module File Errors
Error 8809 Unable to open module file
This error occurs if module files are deleted from the application’s base directory or
from the /usr/tandem/sqlmx/USERMODULES directory and then the associated
application is executed.
This error can also occur if the named module file exists but is not readable. Ask the
module file’s owner to change the permission attributes so that an application can read
the module file.
Error 8808 Module file contains corrupted or invalid data
This error occurs when the timestamp encoded in the module file does not match the
timestamp passed from the application to the CLI. These timestamps are initially
generated by the preprocessor and are used to ensure that the version of the
application is synchronized with the version of the module file. This error can occur if
you run the preprocessor on your embedded SQL, compile the annotated C/C++
output file, but fail to SQL compile the module definition file that the preprocessor
generates. If the SQL/MX compiler has previously compiled a different instance of the
module definition file, a module exists whose name corresponds to the application
module but has a mismatched timestamp.
This error can also occur if you make a copy of an application executable, rebuild the
application (thus overwriting the original instance of the application’s module file), and
then execute the first copy of the application.
A common cause of error 8808 is reuse of code. If you have an embedded SQL source
named myutils.sql, you might build and link myutils with a number of
applications. Each build (that is, preprocessing, c89-compilation, and SQL
compilation) of myutils results in a new copy of the same module file overwriting an
earlier copy. Only the last application built with myutils.sql avoids error 8808.
To avoid error 8808:
•
If you want to reuse embedded modules, use either the grouping or versioning
attributes described in Section 17, Program and Module Management. Qualifying
your module name with a group or version attribute enables the separate builds of
a module to coexist.