For each row when condition : Row Level Trigger « Trigger « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE golf_scores
  2  (timestamp  DATE   NOT NULL,
  3   score      NUMBER NOT NULL,
  4   commentary VARCHAR2(30));

Table created.

SQL>
SQL> CREATE OR REPLACE TRIGGER golf_commentary_under_par
  2  BEFORE INSERT ON golf_scores
  3  FOR EACH ROW
  4  WHEN (NEW.score < 72)
  5  BEGIN
  6    :NEW.commentary := 'Under Par';
  7  END;
  8  /

Trigger created.

SQL>
SQL>
SQL> DROP TABLE golf_scores;

Table dropped.

SQL>








28.4.Row Level Trigger
28.4.1.A row-level trigger
28.4.2.FOR EACH ROW clause identifies this as a row-level trigger
28.4.3.Change value in Row level trigger
28.4.4.For each row when condition