Editing related tables
FM/Db2 provides support for editing tables that are subject to referential integrity (RI) constraints. If you are not familiar with the terms parent table, dependent table, primary key, foreign key and referential integrity, see the relevant Db2® manuals.
This section describes the behavior of the REDIT command when a Db2® error has been encountered, and the Db2® error is an RI violation. For a description of issuing the REDIT command when no RI error has occurred, see Listing related tables.
If FM/Db2 encounters an error when attempting to save the data
changed in an Edit session and the error is due to a RI violation,
it automatically determines the name of the other table (the related
table) in the RI relationship. You can then start another FM/Db2 Edit
session for the related table. The new Edit session (dependent session)
is displayed as a new ISPF logical session, as if you had typed START
on
the command line and then selected FM/Db2 Edit. You can use the ISPF
commands SWAP and SWAP LIST to move between different logical sessions.
FM/Db2 customizes the template for the new Edit session to make the identification of the key columns easier. If the related table is a dependent table, FM/Db2 displays only the rows with values that match the primary key in the parent table. If the related table is a parent table, you can use the IP (Insert primary key) prefix command to insert a row with a primary key matching the foreign key that caused the error.
If an Edit session has active dependent Edit sessions, you cannot save changes made in the session until you end all dependent Edit sessions. If you cancel an edit session that has active dependent Edit sessions, all dependent Edit sessions are also canceled. Any uncommitted changes in any of the dependent Edit sessions are lost.