Preparing distributed relational database programs
When you write a program using SQL, you can embed the SQL statements in a host program.
The host program is the program that contains the SQL statements, written in one of the host languages: PL/I PRPQ, ILE C, COBOL/400, ILE COBOL, FORTRAN/400, RPG/400®, or ILE RPG programming language. In a host program, you use variables referred to as host variables. These are variables used in SQL statements that are identifiable to the host program. In RPG, this is called a field name; in FORTRAN, PL/I, and C, this is known as a variable; in COBOL, this is called a data item.
You can code your distributed Db2 for i programs in a way similar to the coding for a Db2 for i program that is not distributed. You use the host language to embed the SQL statements with the host variables. Also, like a Db2 for i program that is not distributed, a distributed Db2 for i program is prepared using the certain processes.
However, a distributed Db2 for i program also requires that an SQL package is created on the server to access data.
This topic collection discusses these steps in the process, outlining the differences for a distributed Db2 for i program.