Manta alt

YOUR IBM i TRAINING SOURCE

You must allow the browser to execute JavaScript programs if you want to view product information. If your browser is set up to execute JavaScript programs, the problem is that the product ID was incorrect. Use the menu bar above to find the desired product.

Overview

This course describes how to implement referential integrity in a DB2 database. The course begins by describing the concept of referential integrity and discussing how it is implemented in a DB2 database. Next, you will see how to define a referential constraint, the set of rules that defines the relationship between two files. The course then describes how to work with referential constraints and how to resolve a check pending situation.

The course ends by showing how an application can detect a constraint violation.

Approximate Study Time: 90 minutes

Objectives

After completing this course, you should be able to:

  • Use and define referential integrity terminology
  • Name and define the various referential constraint rules
  • Name and describe the different types of physical file constraints
  • List the steps required to implement referential integrity
  • Identify the various referential constraint states
  • Define a unique or primary key constraint
  • Define a referential constraint
  • Display the constraint information for a file
  • Display a list of the records that caused a referential constrain to be marked as check pending
  • Change the status of a constraint
  • Delete a constraint
  • Describe the techniques that can be used in an RPG program to detect a constraint violation
  • Describe the techniques that can be used in a COBOL program to detect a constraint violation

Topic Outline

Introduction to Referential Integrity

Defining Constraints

Working with Constraints

Detecting Constraint Violations in an Application

Audience

This course is intended for programmers and application developers who will be creating physical file constraints and working with files for which constraints have been defined.

Prerequisites

This course assumes that you have a basic knowledge of IBM i facilities. You can satisfy this prerequisite by successfully completing the Introduction to the IBM i Environment series. It also assumes that you have a basic knowledge of DB2. You can satisfy this prerequisite by successfully completing the first course in the series, Introduction to DB2. Finally, it assumes you have a reading knowledge of either RPG IV or COBOL.