The merge operation does not currently work with versioned tables. The optimizer translates the merge into
insert/update statements on the underlying _LT table
To have several versions of data
create table TEST (
one number primary key, -- Without primary key: ORA-20133:
two varchar2(15), three char(2), four clob,
five blob, six date );
insert into test values (1,'Cochin','NO','Kochi is a vibrant city situated on the south-west coast of the Indian peninsula in the breathtakingly scenic and prosperous state of Kerala, hailed as Gods Own Country',null,sysdate);
insert into test values (2,'Kerala','YS','n',null,sysdate);
insert into test values (3,'TVM','NO','n',null,sysdate);
insert into test values (4,'Calicut','NO','n',null,sysdate);
insert into test values (5,'Kannur','YS','n',null,sysdate);
commit;
begin
dbms_wm.enableversioning ('test');
end;
begin
dbms_wm.createworkspace ('B_focus_1');
dbms_wm.createworkspace ('B_focus_9' );
end;
begin
dbms_wm.gotoworkspace('B_focus_1');
dbms_wm.createworkspace ('test' );
end;
select workspace, parent_workspace from user_workspaces;
select * from test order by one;
update test set two='Kasargode',three='NO',four='Top end of Kerala',Six=sysdate where one=2;
commit;
begin
dbms_wm.gotoworkspace('LIVE');
end;
select * from test order by one
begin
dbms_wm.gotoworkspace('B_focus_9');
end;
select * from test order by one
update test set two='Thrissur',three='NO',four='Middle of Kerala',Six=sysdate where one=2;
commit;
select * from test order by one
begin
dbms_wm.gotoworkspace('test');
end;
select * from test order by one
No comments:
Post a Comment