Thursday, February 8, 2018

What is Conditional Predicates and Qualifiers in TRIGGERS PLSQL








 CREATE OR REPLACE TRIGGER EMP_TRIGGER_PREDICATES
      BEFORE INSERT OR DELETE OR UPDATE ON emp
      FOR EACH ROW
    DECLARE
      v_ChangeType CHAR(1);
    BEGIN
      /* Use 'I' for an INSERT, 'D' for DELETE, and 'U' for UPDATE. */
      IF INSERTING THEN
        v_ChangeType := 'I';
     ELSIF UPDATING THEN
       v_ChangeType := 'U';
     ELSE
       v_ChangeType := 'D';
     END IF;

     DBMS_OUTPUT.put_line(v_ChangeType ||'- '|| USER ||'-' ||SYSDATE);
   END EMP_TRIGGER_PREDICATES;
   /
   

No comments:

Post a Comment