DB2 SQL Application Programming

Db2 SQL Application Programming


Application programmers and designers seeking a solid grounding in SQL and how it is used interactively and embedded in host language program using IBM's Db2 database under both z/OS and LUW platforms.  The course is delivered at the latest release level, presently Db2 13, previous releases can be covered on request.


Delegates should have some knowledge of a relevant supported application language (eg. COBOL, PL1, Java, C++ etc...). Please inform us of the language and platform in use when booking the course.


5 days. Hands on.

Course Objectives

The aim of this course is to provide the programmer, unfamiliar with Db2, with the necessary skills required to define, access and manipulate D2bdata, either via an application program or using SPUFI.  The course contains many practical exercises to ensure familiarity with the product. Initially students create Tables and Indexes, and then proceed to develop COBOL or PL/I programs accessing the data held on the DB2 Tables. By the end of the week, students will be ready to start the development of application programs accessing DB2 data.

On completion of this course the student will be able to:


  • set up a Db2 test environment, using correctly defined tables, views, indexes, synonyms and aliases
  • use both permanent and temporary tables
  • use the Db2I toolset, including SPUFI
  • code SQL statements to read and manipulate DB2 data
  • develop, prepare and execute Db2 programs
  • bind packages and plans
  • use non-scrollable and scrollable cursors
  • use multi-row INSERT and FETCH processing
  • describe the locking process used by Db2
  • define and use Referential Integrity
  • use Identity Columns and Sequences
  • produce EXPLAIN output using a PLAN_TABLE
  • use the LOAD utility to populate tables

Course Content

The Relational Model
Data Representation
The DB2 Environment
The DB2 Table
Accessing The Data
Interfaces to DB2
SQL Structure
Embedded SQL
DB2 Data Relationships
Access Path Selection
DB2 Table Structure
DB2 Data Types
DB2 Catalog
DB2 Interactive
Database Design / Data Analysis
Overview Of Normalisation
First Normal Form
Order Form Example
Second Normal Form
Third Normal Form
Check 3nf

The Structure Of DB2 Objects
Definition Of DB2 Objects - DDL
Database Definition
Tablespace / Page Organisation
Page Sizes
Tablespace Layout
Types Of Tablespace
Tablespace Definition
Table Definition
Table Names
Copying Table Definitions
Rename Table
Data Partitioning
DB2 Column Types
Null Values
User Defined Default Values
Global Temporary Tables
Declared Temporary Tables
Declared Temporary Table Considerations
Declared Temporary Tables - Comparisons
DB2 Views
Read Only Views
Views - With Check Option
Creating A View Of Two Tables
DB2 Synonym
DB2 Alias
The Alter Statements
DB2 Indexes
Index Organisation - The B Tree Index
Index Clustering
Non-Unique Indexes
Index Definition
Partitioning Indexes
Index Design Considerations
The Drop Statement

DB2I Options
SPUFI - SQL Processor Using File Input
Running Queries
SPUFI Defaults
SPUFI - Setting Autocommit to NO
DB2 Commands
DB2 Utilities
The DB2I Defaults Panel

Utility Overview
Running Utilities
The LOAD Utility
The Load Utility Syntax
Online Load Resume
Online Load Considerations


Virtual Courses

ALL of our courses can be delivered virtually! Our Bath public schedule courses are available as live virtual sessions, using the popular Zoom Virtual Classroom and remote labs. Delegates can test their access at: www.zoom.us/test

Public Courses

On-Site Courses

Can't attend one of our public classes? Booking for multiple people?

All our courses are available on your site! Delivered for your staff, at your premises.

Contact us to find out more...