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-3
Compiling Embedded SQL C/C++ Programs With
Embedded Module Definitions
Although this figure shows individual steps for clarity, you can use c89 or the HP
Enterprise Toolkit—NonStop Edition (ETK) to automate the process. For information on
using c89 in this way, see c89 Utility: Using One Command for All Compilation Steps
on page 15-34. For more information on using ETK, see ETK online help.
These steps correspond to the steps in Figure 15-1 on page 15-3.
1. Create the C or C++ source file that contains embedded SQL statements
(sqlprog.sql).
Figure 15-1. Compiling Embedded SQL C/C++ Programs With Embedded Module
Definitions
SQL/MX
C/C++ Source File
sqlprog.sql
SQL/MX
C/C++ Source File
sqlprog.sql
SQL/MX
C/C++ Preprocessor
(mxsqlc)
C/C++ Annotated
Source File
sqlprog.c or
sqlprog.cpp
C/C++ Annotated
Source File
sqlprog.c or
sqlprog.cpp
Linker
C/C++ Compiler
C/C++ Object File
sqlprog.o
C/C++ Object File
sqlprog.o
7
C/C++ Program
(executable) File
sqlprog.exe
C/C++ Program
(executable) File
sqlprog.exe
SQL/MX Compiler
(mxCompileUserModule)
(mxcmp)
vst141.vsd
SQL/MX Module
SQL/MX Module
8
Object
Libraries
SQL CLI and
Executor
Application
Process
sqlprog.exe
Can SQL compile
object file for early
error detection
9
6
5
4
3
2
1