DB2 Server for VSE & VM: Application Programming


What is SQL?

DB2 Server for VSE & VM data is handled by the Structured Query Language (SQL), which contains statements that retrieve, delete, insert, and update tables in a DB2 Server for VSE & VM database. You can embed these statements in application programs written in any of the following host languages: assembler language, C, COBOL, FORTRAN, PL/I, or REXX (for DB2 Server for VM).

These SQL statements do all data handling, thereby decreasing the data handling done by the programs themselves. Programs that access DB2 Server for VSE & VM data can also access data from other sources, such DL/I databases (for VSE) and CMS files (for VM).

Embedding SQL Statements in Host Language Programs

Programs that use the DB2 Server for VSE & VM database management system are host programs because they act as hosts for SQL. How you embed SQL statements varies for each of the supported host languages.

The core of SQL is the same for each host language. For this reason, the SQL statements are presented throughout this book in basic form unless otherwise noted: that is, without any of the language-dependent delimiters.

In this book, examples that have combinations of SQL statements and host language statements are shown in a language-independent form called pseudocode. Pseudocode shows program logic but must be recoded in a specific programming language before it can be used. When SQL statements are shown in pseudocode examples, they are preceded by the words EXEC SQL to help you distinguish them from the pseudocode. When shown by themselves, they are not preceded by these words.

To use SQL statements in a programming language, you must be familiar with the rules for embedding them in that language. These rules are discussed in Appendix section of this manual (one for each language).

You should browse through the appropriate appendix before you continue reading, and refer to it as needed when you are ready to code your first DB2 Server for VSE & VM application. You can also refer to Chapter 6 of the DB2 Server for VSE & VM SQL Reference manual for information on SQL statements.

Using DB2 Server RXSQL (DB2 Server for VM Only)

The REXX Interface Installation (DB2 Server RXSQL) extends the support of the database manager to include REXX as a host language. SQL statements are supported in DB2 Server RXSQL by DB2 Server RXSQL requests that are imbedded in REXX programs. Because REXX is an interpretive language, DB2 Server RXSQL requests do not need to be preprocessed or compiled before they are run. You can compile REXX programs, but this has no effect on the DB2 Server RXSQL requests. You can use DB2 Server RXSQL to:

For a discussion of application programming using REXX, refer to the DB2 REXX SQL for VM/ESA Installation and Reference manual.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]