There are three particular aspects to consider for IRDs:
- It is very seldom that an IRD is a complete solution, and you nearly always require an
FBE in conjunction with an IRD.
- When you are migrating to multiple DB2® tables,
your IRD must include code to handle the initial data migration process.
- One table must be mapped in CICS® VT,
and this table must contain one DB2 record
for every record in the VSAM file. In some cases, a DB2 table containing just key columns may be
required.
For a multiple table solution, you write the IRD before the FBE.
This reasons for this become clear as you read this section.
There is potential overlap between the functionality in an FBE
and an IRD for a multiple table migration but there are two important
facts to keep in mind:
- An FBE is invoked for every VSAM call
- An IRD is only invoked for an update-type call
Because an IRD is not involved in a retrieval call, the conversion
of data from its DB2 form to
the equivalent VSAM form must be handled by the FBE. For update calls,
conversion from VSAM form to DB2 form
can be done in either the FBE or the IRD.
In general, the FBE includes SQL SELECT statements, sometimes using
a cursor. The IRD includes INSERT and UPDATE SQL statements, and in
some occasions SELECT statements. DELETE processing is normally achieved
by DB2 referential integrity
cascading deletes.