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-51
Deploying a Static SQL Application to an RDF
System
4. On the development system \robin, create static SQL C/C++ source files (for
example, nonstop1.sql and nonstop2.sql):
// nonstop1.sql
EXEC SQL MODULE nonstop1mod;
int main() { ...
EXEC SQL INVOKE =debits AS debits_type;
EXEC SQL UPDATE =debits SET balance = balance + ?;
...
}
// nonstop2.sql
EXEC SQL MODULE nonstop2mod;
int pay() { ...
EXEC SQL INVOKE =credits AS credits_type;
EXEC SQL UPDATE =credits SET balance = balance + ?;
...
}
5. On the development system \robin, set up a separate directory for building the
RDF backup \indus version of the self-contained application executable. Set up
DEFINEs, run the preprocessor, the C/C++ compiler, native linker, and SQL/MX
compiler. For TNS/R native applications:
cd /usr/backup
add_define =debits class=map \
file=\\robin.$data07.ccards.debits
add_define =credits class=map \
file=\\robin.$data17.ccards.credits
mxsqlc nonstop1.sql -c nonstop1.cpp -g \
moduleSchema=comms.mods
mxsqlc nonstop2.sql -c nonstop2.cpp -g \
moduleSchema=comms.mods
c89 -Wversion2 -I /usr/tandem/sqlmx/include -c nonstop1.cpp
c89 -Wversion2 -I /usr/tandem/sqlmx/include -c nonstop2.cpp
nld -elf -set systype oss -set highpin off \
-set highrequestor on -set inspect on \
-obey /usr/lib/libc.obey -set saveabend on \
/usr/lib/crtlmain.o nonstop1.o nonstop2.o -l zcplsrl \
-l zcrtlsrl -l zcresrl -l zcplosrl -l ztlhgsrl \
-l ztlhosrl -Bdynamic -l zclisrl -o nonstop.exe
mxCompileUserModule -d SIMILARITY_CHECK=on -d \
AUTOMATIC_RECOMPILATION=on nonstop.exe
6. On the development system \robin, set up a separate directory for building the
RDF primary \APPLE version of the self-contained application executable. Set up
DEFINEs and run the preprocessor, the C/C++ compiler, native linker, and
SQL/MX compiler. For TNS/R native applications:
cd /usr/primary
add_define =debits class=map \
file=\\robin.$data07.ccards.debits
add_define =credits class=map \
file=\\robin.$data17.ccards.credits
mxsqlc nonstop1.sql -c nonstop1.cpp -g \