Db2 for i distributed relational database example program

A relational database example program that uses remote unit of work is included with SQL. Several files and members within the QSQL library can help you set up an environment that runs a distributed Db2 for i example program.

To use these files and members, you need to run the SETUP batch job located in the file QSQL/QSQSAMP. The SETUP batch job allows you to customize the example to do the following:

  • Create the QSQSAMP library at the local and remote locations.
  • Set up relational database directory entries at the local and remote locations.
  • Create application panels at the local location.
  • Precompile, compile, and run programs to create distributed example application schemas, tables, indexes, and views.
  • Load data into the tables at the local and remote locations.
  • Precompile and compile programs.
  • Create SQL packages at the remote location for the application programs.
  • Precompile, compile, and run the program to update the location column in the department table.

Before running the SETUP, you may need to edit the SETUP member of the QSQL/QSQSAMP file. Instructions are included in the member as comments. To run the SETUP, specify the following command on the system command line:

 
========> SBMDBJOB QSQL/QSQSAMP SETUP
 

Wait for the batch job to complete.

To use the example program, specify the following command on the command line:

========> ADDLIBLE QSQSAMP
 

To call the first display that allows you to customize the example program, specify the following command on the command line.

========> CALL QSQ8HC3
 

The following display opens. From this display, you can customize your database example program.

SAMPLE ORGANIZATION APPLICATION
 
 
ACTION...........:          A  (ADD)                  E (ERASE)
                            D  (DISPLAY)              U (UPDATE)
 
OBJECT...........:          DE (DEPARTMENT)           EM (EMPLOYEE)
                            DS (DEPT STRUCTURE)
 
SEARCH CRITERIA..:          DI (DEPARTMENT ID)     MN (MANAGER NAME)
                            DN (DEPARTMENT NAME)   EI (EMPLOYEE ID)
                            MI (MANAGER ID)        EN (EMPLOYEE NAME)
 
LOCATION.........:                    (BLANK IMPLIES LOCAL LOCATION)
 
DATA.............:   
 
 
 
 
                                                            Bottom
 
F3=Exit