Question
Modifying Class Key which has around 1 Million instances
Hi All,
We have a class who key is defined as say Column A.
There are around 1 million instances of this class. Now we have to modify the key of this class and include another column, say column B, as key.
I know that we have to delete the instances, then update the class rule to add the new column as key. But the problem is updating all the 1 million records with an one time activity to open and re-save will take a lot of time.
We want to know if there is any alternate way of doing this.
Hi ,
You are correct , We cannot modify the keys of a class for which Instances are already created.
Pega does not allow to modify the keys of a class if it have some existign work objects in DB, give a try as per below procedure.
1. Copy all the instances to a another temporary table in DB manually.
2. Truncate the original table.
3. Now change the keys to the class form.
4. Put back all the records to the original table.
5. Obj-Browse all the records with complete BLOB data on the clipboard page.
6. Loop through all the pages and do Obj-Save with commit.
7. So new records are generated to the DB with new keys.
8. Delete the old records from the data base by using like query on pzInsKey column.
Thanks,
Manju