DB2 System RI and User RI Selection or Exclusion.

Document ID : KB000011115
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

RC/Extract for DB2 for z/os (RCX) is able to use both DB2 Defined System RI and RI created by CA RI/Manager called "User Defined RI". User Defined RI is only recognised by products that are part of the CA Database Management for DB2 for z/os tools including RCX and Fast Check to name two.

Question:

When a table has both DB2 system defined unique key and a user defined key, does RCX allow the user to select or exclude the system RI or the user RI?

Environment:
Db2 for Z/os
Answer:

Yes, RCX will allow the user to select or exclude the system RI, the user RI or both under Relationship Display Mode.

If RCX is currently in object mode, issue the MODESW command from the command line during source definition creation or update into the source definition and issue the command.

Here is the display when in relationship mode:


PLAN: Display plan report MODESW: Object Display Mode
Source Definition: authid.ADHOC Source SSID: ssid
Description ===> Share Option ===> U
Start Object Parameters: -----------------------------------------------------
Sampling Ratio ==> ____ of ____ Initial No. Rows ==> _______
WHERE Clause ==> N ________
Key File Input ==> N ________________________________________________________
Registry SSID: ssid ------ Display Mode: Relationship --------------- authid
CMD STATUS PARENT CHILD RELNAME CP PC
___ EXCLUD ADHOC_LETTER ADHOC_LETTER_LINE AHLALL01 N N
___ SELECT ADHOC_LETTER ADHOC_LETTER_LINE SRC_CD_A Y Y

Use the "X" line command(Exclude) on the relationship you don't want in the CMD column. EXCLUD shows in the STATUS column.

The type of relationship that these are can be seen by using the PLAN command and then the EXPLODE command.

Relationship SRC_CD_A is User Defined and  AHLALL01 is DB2 created.

The PLAN/EXPLODE display shows:


_ STEP# 1         OBJECT: authid.ADHOC_LETTER
  REASON:
     THIS OBJECT WAS SELECTED AS THE STARTING OBJECT.
  ------------------------------------------------------------------
_ STEP# 2         OBJECT: authid.ADHOC_LETTER_LINE
  REASON:
     RI/MANAGER RELATIONSHIP SRC_CD_A INDICATES THAT THIS OBJECT
        IS A CHILD OF authid.ADHOC_LETTER, PROCESSED IN
        STEP(S) 1.
  ------------------------------------------------------------------

Above you can see "RI/MANAGER RELATIONSHIP SRC_CD_A" which shows that the User Defined Relationship is the one being used.

 

Additional Information:

Define RI Relationships

User-Defined Referential Integrity Support in RC/Extract