DB2 Server for VSE & VM: Application Programming


A C Sample Program

ARIS6CD is a C language sample program for VSE systems that is shipped with the DB2 Server for VSE product. ARIS6CC is a C language sample program for VM systems that is shipped with the DB2 Server for VSE product. It resides on the production disk for the base product. You may find it useful to print this sample program before going through this appendix as the hard copy will provide an illustration for many of the topics discussed here.

The program satisfies the requirements of the application prolog and epilog. Near the beginning of the program all the host variables are declared, and error handling is defined. Near the logical end of the program, the database changes are rolled back, to assure that the database remains consistent for each use of the sample program. (For your own applications, of course, you will enter a COMMIT statement.)

To determine the types of C host variables to declare, refer to Figure 115 which gives the C representation for each of the DB2 Server for VSE & VM data types. Note the following:

When you are coding your own applications, you will need to obtain the data types of the columns that your host variables interact with. This can be done by querying the catalog tables. (These tables are described in the DB2 Server for VSE & VM SQL Reference manual.)


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