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-8
Creating Modules: From Development to Production
9. The SQL/MX compiler compiles the SQL source statements from the module 
definition file into a module file, generates SQL object code for each statement, 
determines an optimized execution plan for each SQL statement against the 
database, and stores the code and plan in the SQL object program. The module is 
stored in the local application directory or in the global 
/usr/tandem/sqlmx/USERMODULES directory.
Run the C/C++ executable program.
Creating Modules: From Development to Production
While HP recommends that you use embedded module definitions to create SQL 
modules, you might find it easier for debugging purposes to use module definition files 
during early stages of development and then switch to embedded module definitions 
upon deployment of your production system. Consider this:
•
With embedded module definitions, you must successfully compile the output from 
the preprocessor before you can SQL compile the embedded module definition. 
You must diagnose host language errors in the source program before you can 
diagnose SQL errors in the source program.
•
With module definition files, you compile the source file and the module definition 
file at the same time. This method provides the opportunity to diagnose both host 
language errors and SQL errors in the source file concurrently.
Embedded module definitions provide greater efficiency in the deployment of an 
application to a production environment. 
Running the SQL/MX C/C++ Preprocessor
The SQL/MX C/C++ preprocessor is available for these environments:
•
OSS
•
Microsoft Windows
•
Enterprise ToolKit—NonStop Edition (ETK) 
The preprocessor for the OSS environment is installed when you install NonStop 
SQL/MX on your system. You must install the Windows-hosted preprocessor on your 
Windows workstation. For information, see the SQL/MX Installation and Management 
Guide.
The syntax for using the preprocessor in each environment appears under Syntax for 
the OSS-Hosted SQL/MX C/C++ Preprocessor on page 15-16 and Syntax for the 
Windows-Hosted SQL/MX C/C++ Preprocessor on page 15-21.
Note. ETK is a GUI-based extension package to the Visual Studio .NET product. Use ETK to 
edit, compile, build, and deploy applications written in a variety of programming languages with 
embedded SQL/MX. For more information, see ETK online help.










