Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_WM , 35 of 52
This procedure resolves conflicts between workspaces.
DBMS_WM.ResolveConflicts( workspace IN VARCHAR2, table_name IN VARCHAR2, where_clause IN VARCHAR2, keep IN VARCHAR2);
This procedure checks the condition identified by table_name
and where_clause
, and it finds any conflicts between row values in workspace
and its parent workspace. This procedure resolves conflicts by using the row values in the parent or child workspace, as specified in the keep
parameter; however, the conflict resolution is not actually merged until you commit the transaction (standard database commit operation) and call the CommitResolve Procedure to end the conflict resolution session. (For more information about conflict resolution, including an overall view of the process, see Oracle9i Application Developer's Guide - Workspace Manager.)
For example, assume that for Department 20 (DEPARTMENT_ID = 20
), the MANAGER_NAME
in the LIVE
and Workspace1
workspaces is Tom
. Then the following operations occur:
manager_name
for Department 20 is changed in the LIVE
database workspace from Tom
to Mary
.
manager_name
for Department 20 is changed in Workspace1
from Tom
to Franco
.
Workspace1
changes to the LIVE
workspace.
At this point, however, a conflict exists with respect to MANAGER_NAME
for Department 20 in Workspace1
(Franco
, which conflicts with Mary
in the LIVE
workspace), and therefore the call to MergeWorkspace Procedure does not succeed.
'Workspace1'
, 'department'
, 'department_id = 20'
, 'child'
).
After the MergeWorkspace Procedure operation in step 7, the MANAGER_NAME
value will be Franco
in both the Workspace1
and LIVE
workspaces.
Workspace1
changes to the LIVE
workspace.
The following example resolves conflicts involving rows in the DEPARTMENT
table in Workspace1
where DEPARTMENT_ID
is 20, and uses the values in the child workspace to resolve all such conflicts. It then merges the results of the conflict resolution by first committing the transaction (standard commit) and then calling MergeWorkspace Procedure.
EXECUTE DBMS_WM.BeginResolve ('Workspace1'); EXECUTE DBMS_WM.ResolveConflicts ('Workspace1', 'department', 'department_id = 20', 'child'); COMMIT; EXECUTE DBMS_WM.CommitResolve ('Workspace1');
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|