SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)
C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—544617-003
15-66
Understanding and Avoiding Some Common Run-
Time Errors
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.
•
Build myutils.sql only once, and then link the resulting myutils.o file to each
application.
When you need to rebuild myutils for each application, you can either edit the
myutils.sql source and change the name of the module that you give in the
MODULE directive, or you can avoid the MODULE directive and let the
preprocessor generate the module name.










