Updating primary key db2

15 Mar

We decided to add this restriction in 2.0.0 of two reasons.First, the Objective-C/Swift product already had the restriction, and it is important to agree on the behaviour of primary keys.This is on the target side of your replication environment.I learned a few things about the options you have to sort through.Adding schema information to a Data Set object before filling it with data ensures that primary key constraints are included with the Data Table objects in the Data Set object.As a result, when additional calls to fill the Data Set are made, the primary key column information is used to match new rows from the data source with current rows in each Data Table object, and current data in the tables is overwritten with data from the data source.

updating primary key db2-27updating primary key db2-36updating primary key db2-88updating primary key db2-27

If a column in a data source is identified as auto-incrementing, the Fill Schema method, or the Fill method with a Missing Schema Action of Add With Key, creates a Data Column with an Auto Increment property set to true.

But on a side note, updating fact table keys is a very critical operation.

I would rather create a temp fact table, load all records from fact table to the temp fact table, but load the NEW key values by looking up on dimensions.

This is part two of lessons learned during a recent DB2 SQL Replication engagement.

After registering a source table for replication and creating an Apply Control server, you need to create a new Subscription set under that Apply Control server.