Oracle触发器,删除一条数据的同时删除另一张表的关联数据
背景:
主表TableA
关联表TableB
共同的ID:table_ID
建立触发器语句:
create or replace trigger Trigger_Name
after delete on TableA
for each row
begin
delete TableB where table_ID=:old.table_ID
end;
/
查询已有的触发器语句:
desc user_triggers
select trigger_name,table_name,description from user_triggers;