Create or replace trigger t_after_table -- create or replace trigger name
After insert --- time after/before event insert or update or delete
On student --- role table on tablename
For each row -- specifies whether to execute a trigger for each affected row, that is, a row-Level Trigger. If this clause is not used, it is a statement-Level Trigger.
Declare -- trigger topic
Begin
Insert into student_state (SSID, ssstate) values (: New. Sid,: New. Sid );
End;
Note:
Before and after: triggers are activated before or after an event occurs.
Instead of: if this clause is used, the trigger can be executed.CodeTo replace the event that causes the trigger to call.
Insert, delete, and update: Specifies the data operation type that constitutes the trigger event. Update can also create a list of columns.
Referencing: specify other names of the new (to be updated) and old (Before update) rows. The default values are new and old.
Table_or_view_name: name of the table or view for which the trigger is to be created.
For each row: Specifies whether to execute a trigger for each affected row, that is, a row-Level Trigger. If this clause is not used, it is a statement-Level Trigger.
When: the condition that restricts the execution of the trigger. This condition can include the new and old data worth checking.
Declare --- end: a standard PL/SQL block.