There are two ways to use an import information editing UOC routine to import update information into a target database:
- By issuing SQL statements
- By output to a work file
The following figure shows the procedure for importing update information.
Figure 8-1 Procedure for importing update information using an import information editing UOC routine
![[Figure]](FIGURE/RZ08S010.GIF)
- Issuing SQL statements
With this method, the import information editing UOC routine issues SQL statements based on the update information received from the target Datareplicator, and then imports the update information into the target database.
- Output to a work file
With this method, the import information editing UOC routine edits update information received from the target Datareplicator and outputs it to a work file. It then uses a UAP to retrieve the update information from the work file, and imports it into the target database.
- Organization of this subsection
- (1) Flow of control during processing by an import information editing UOC routine
- (2) Units in which update information is passed
The following figure shows the flow of control during processing by an import information editing UOC routine and the target Datareplicator.
Figure 8-2 Flow of control during processing by an import information editing UOC routine
![[Figure]](FIGURE/RZ08S020.GIF)
- Start instruction
- When the target Datareplicator is started, a start instruction is issued to the UOC routine as an extend starting import processing (call to UOC's hds_ubegin()).
- Import information editing instruction
- The import process reads the update information sent from the source system and issues an update information editing instruction for each update information item that has been read (call to UOC's hds_uedit()).
- Termination instruction
- When the target Datareplicator is terminated, a termination instruction is issued to the UOC routine as an extension of terminating the import processing (call to UOC's hds_uend()).
The functions of the import information editing UOC are called at the following times:
- hds_ubegin()
This function is called only when import processing is started (when the import process is started by the hdsstart or hdsrfctl command or is restarted by detection of a definition change# or mode change event).
- hds_uedit()
This function is called for each update information item.
- hds_uend()
This function is called only when import processing is terminated (when the import process is terminated by the hdsstop or hdsrfctl command or is terminated temporarily by detection of a definition change# or mode change event).
#: As for a detection of a definition change, if selection definitions are used in XDM/DS, the definitions are sent each time connection is re-established with the target system and hds_ubegin() and hds_uend() are called, even when no change has been made to the definitions.
The following shows the number of executions of each function during normal processing (from start to termination of the target Datareplicator), where n is the number of updates:
- hds_ubegin(): 1
- hds_uedit(): 1 to n
- hds_uend(): 1
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.