A beforedelete trigger was created when I first came into contact with Oracle, but ldquo was always reported. Warning: the trigger was created with the compilation error rdquo. Finally, it was found that it was in the trigger.
A before delete trigger was created when I first came into contact with Oracle, but ldquo was always reported. Warning: the trigger was created with a compilation error rdquo. Finally, it was found that it was inside the trigger.
When I first came into contact with Oracle, I created a before delete trigger, but always reported "Warning: The created trigger has a compilation error". Finally, I found that the statement in the trigger did not write a semicolon.
The following post is also for reference:
1. Create a table:
Create table test1 (CardID number, Name NVARCHAR2 (20), Sex NUMBER );
Create table test2 (CardID number, Name NVARCHAR2 (20 ));
Create table test3 (CardID number, Name NVARCHAR2 (20 ));
2. Trigger -- back up the record in Test2 to Test3 When deleting it:
Create or replace trigger Trig_Del_Backup
After delete
On test2
For each row
Declare
-- Fdsfaf
Begin
Insert into test3 values (: old. cardid,: old. name );
End
;
/
3. Trigger -- delete Test1 When deleting Test2:
Create or replace trigger Trig_Del
After delete
On test2
For each row
Declare
-- Fdsfaf
Begin
Delete from test1 where CardID =: old. CardID and Name =: old. name;
End
;
/