在一张表中插入数据 id = 'AAABBB' 时,想同时插入id = 'BBBAAA'的一条数据,其他字段完全一致。
就是说本表的数据都是成对出现,两条数据更新时同时更新,删除时同时删除
行级触发器无法同时操作本表其他行数据,有没有其他解决的方案。
谢谢!!
表是领导设计的,你们懂的!
就是说本表的数据都是成对出现,两条数据更新时同时更新,删除时同时删除
行级触发器无法同时操作本表其他行数据,有没有其他解决的方案。
谢谢!!
表是领导设计的,你们懂的!
表不变,仍然只插入一条记录AAABBB。为该表建一个视图,视图采用union方式动态加上BBBAAA的记录,对该表的查询改为对视图的查询,这样就不需要那么麻烦的维护两条数据了。
这样可否
after insert or update or delete on test
pragma autonomous_transaction;
begin
if updating then
dbms_output.put_line('修改');
elsif deleting then
dbms_output.put_line('删除');
elsif inserting then
dbms_output.put_line('插入');
end if;
end;