Saturday, 22 June 2013

TRIGGER WHICH WILL BE FIRED FOR EACH INSERT OR UPDATE ON ENAME OR JOB COLUMNS IN ORACLE?



SQL> CREATE TRIGGER EMP_UPPER
  2 BEFORE INSERT OR UPDATE OF ENAME, JOB ON EMP
      FOR EACH ROW
  3 BEGIN
  4 :NEW.ENAME := UPPER (:NEW.ENAME);
  5 :NEW.JOB := UPPER (:NEW.JOB);
  6 END;
  7 /

Trigger created.

SQL> @ TIRGGER;

SQL> INSERT INTO EMP (EMPNO, ENAME, JOB) VALUES  
         (12,'anshu','lecturar');
 1 row created.

No comments:

Post a Comment