Your C and C++ source files can have SQL statements embedded within the source code.
If you are using Data Access Builder, you never have to deal with embedded SQL directly. Data Access Builder generates source code that uses DB2 embedded SQL or ODBC drivers to access databases. Data Access Builder can also create parts that you can use in visual programming. Data Access Builder updates your configuration file as required to automate the process of building an application that accesses databases, including the SQL precompilation step.You can greatly increase your productivity by using Data Access Builder rather than programming your database operations manually.
You can also use DB2 directly, if it is installed on your workstation. In this situation, you do write C or C++ code that contains embedded SQL, and must explicitly precompile that code as a step in your builds. VisualAge C++ provides a build extension that you can use to run the DB2 SQL precompile function easily from your configuration file. The DB2 SQL precompile function is a command line function to precompile C or C++ source files that contain SQL statements. You can use the build extension only only when DB2 is available.
The DB2 SQL precompile build extension produces C or C++ source files that you can use as ordinary C or C++ source files for your build.
![]()
The Data Access
Builder
Visual
Programming Fundamentals
Configuration Files
Build Extensions and Specification (.ice) Files
![]()
Precompile Embedded SQL During a
Build
![]()
Build Extensions Supplied with
VisualAge C++
