Building embedded SQL applications written in C or C++ (Windows)
After you have written the source file, you have to build your embedded SQL application.
About this task
Some steps in the build process depend on the compiler that you use. The examples provided with each step of the procedure show how to build an application called myapp with a Microsoft Visual Studio 6.0 compiler, which is a C compiler. You can run each step in the procedure individually or run the steps together within a batch file from a Db2® Command Window prompt. For an example of a batch file that can be used to build the embedded SQL sample applications in the %DB2PATH%\SQLLIB\samples\c\ directory, refer to the %DB2PATH%\SQLLIB\samples\c\bldapp.bat file. This batch file calls another batch file, %DB2PATH%\SQLLIB\samples\c\embprep.bat, to precompile the application and bind the application to a database.
- An active database connection
- An application source code file with the extension .sqc in C or .sqx in C++ and containing embedded SQL
- A supported C or C++ compiler
- The authorities or privileges required to run the PRECOMPILE command and BIND command