Update key columns
When you specify a column as a key column, the value in that column is used to determine whether a row produced by a mapping operation should be inserted as a new row into the table or should be used to update existing row(s) in a table.
- If the values in the rows generated by the mapping operation match the values in the key columns as defined in the Database Interface Designer, the specified update columns are updated.
- If the values in the rows generated by the mapping operation do not match the values in the key columns, the rows are
inserted as new rows into the table or view as defined in the Database Interface Designer. Note: You can override the behavior defined in the Database Interface Designer by using the command line to specify the appropriate database adapter commands for the database adapter. For information about the database-specific adapter commands, see the Resource Adapters documentation.
- If more than one column is designated as a key column, the values generated by a map must match the values in each designated key column for the row to be updated.
- If your map generates a row with key column values that match more than one existing record, all of the matching records in the columns you have specified as update columns are updated with the new row values.
- If your map produces multiple rows with the same values for the key columns, you lose any updates that are made as a result of all but the last row. The updates produced by each row are overwritten by the updates from subsequent rows with the same key values.