Select / Update Criteria

The Select / Update function on a Mapping screen lets you update selected fields in a target database. This screen is used only for the JDBC data source, as it allows you to synchronize new data with existing data in a target database. As a result of a data transfer, target records are created for the target data source. Using this screen target records can be updated in very specific ways. For each record created you can specify criteria in this screen for merging the new data with data already in the target source. Briefly you first check for the existence of matching target records and then decide on the basis of specific update criteria, whether to insert the new data record or leave the existing record.  Merge updates will only occur where the update information provides the appropriate mapping.

Note that when using the Select / Update Criteria screen, select fields do not have to be the same as the update fields. The select fields chosen will determine which rows get retrieved. The update fields are the one used for comparison to determine if the row needs to be updated. In normal insert/update environments this can be left blank.

In the target data source there must be at least one field with the Unique Key property of the field turned on. This is used by the system to decide which rows if any to insert or update. If there is no Unique Key and you are trying to use the SELECT/UPDATE strategy, then when a condition is found that will cause an UPDATE to a row, it will fail because the row cannot be uniquely identified in the generated update statement.

Use the Select / Update icon on the Mapping window when a target entity is selected, to access the Select / Update criteria. At the top of the screen the current entity from the Mapping screen is identified, and you choose whether to perform a select/update on this entity:

The Select fields area of the screen is used to identify matching records, and Update criteria allows a comparison between new and existing records. On the basis of this information you can  make a decision for each field, whether to update it or not.  

If a record matching the select fields is found, then the Update criteria information is processed

A merge update of the data source will not overwrite fields unless they have been mapped, i.e. unless they meet the update criteria specified in this section of the screen.

Related topics include Mapping, Example JDBC mapping