2

I'm trying to merge two workspaces that contain version-enabled tables. I can't figure out how to resolve conflicts, because I have a lot of rows with the same ID value. They differ only in time interval. If I execute something like this:

DBMS_WM.ResolveConflicts('W_CHILD', 'SOME_TABLE', 'ID=1', 'CHILD');

Which row will be used? How can I specify concrete row?

xxx_CONF table content

0

Conflicts are automatically detected when a merge or refresh operation is requested, and they are presented to the user in conflict views. There is one conflict view for each table.Each conflict view has a name in the form table_name_CONF.
To keep the rows that you want, first of all let me show you the syntax of ResolveConflicts procedure.

DBMS_WM.ResolveConflicts(
   workspace     IN VARCHAR2,
   table_name    IN VARCHAR2,
   where_clause  IN VARCHAR2,
   keep          IN VARCHAR2);

You can use 'keep' parameter to decide on which(Parent, Child or Base) to resolve the conflicts.
In your case you have define 'CHILD' for keep parameter. And where_clause(ID=1 in your case) identifies the rows to be refreshed . Your procedure resolves conflicts involving rows in the SOME_TABLE table in W_CHILD where ID is 1, and uses the values in the child workspace to resolve all such conflicts.
For details visit Oracle documentation:DBMS_WM Package: Reference

2
  • But can I use different versions of row from different sources? For example: if I want to use row with WM_VALID = "01.02.16 14:08:07,280000000 +03:00" from W_CHILD workspace, where WM_VALID is NULL from W_PARENT and others from BASE. I can't define 3rd parameter of ResolveConflicts function as 'ID=1 AND WM_VALID=_something_' because WM_VALID isn't primary key. – Sergey Bolotaev Feb 2 '16 at 13:15
  • It is possible to achieve that goal, but is not handled automatically by Workspace Manager. I think you could update the child row to contain the necessary values from the parent row prior to resolving the conflict or resolve in favor of the parent and update using the child row values. But i havenot tested it yet. – atokpas Feb 2 '16 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.