Using the DB2 C/C++ precompiler
The DB2® C/C++ precompiler scans source code for potentially SQL-related keywords, such as the following:
- Host variables that can be used in SQL statements in the same source.
- SQL statements that start with the token pair EXEC SQL.
An advantage of using the DB2 C/C++ precompiler instead of the XL C/C++ DB2 coprocessor is that you can obtain a more useful message listing by preprocessing, precompiling, and then compiling source code with embedded SQL statements. Compiler diagnostics refer to line numbers of the translated output from the DB2 C/C++ precompiler, not to the line numbers of your source code. This means that you need both the DB2 C/C++ precompiler listing and the compiler listing to work through the compilation errors. Runtime troubleshooting tools also refer to coordinates of the DB2 C/C++ precompiler output.