Precompilation of embedded SQL applications that access more than one database server
You must write your
embedded SQL applications such that the application is able to distinguish
which database server receives each SQL statement.
To precompile an application program that accesses more than one
server, you can do one of the following tasks:
- Split the SQL statements for each database into separate source files. Do not mix SQL statements for different databases in the same file. Each source file can be precompiled against the appropriate database. This is the recommended method.
- Code your application using dynamic SQL statements only, and bind against each database your program will access.
- If all the databases look the same, that is, they have the same definition, you can group the SQL statements together into one source file.
The same procedures apply if your application will access a host
application server through Db2
Connect.
Precompile it against the server to which it will be connecting, using
the PREP
options available for that server.