title: TRIGGER Oracle to prevent updating or inserting
body: <p>I am having problems with this code below, which is a trigger used in Oracle SQL:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER TRG_TUTOR_BLOCK
  BEFORE INSERT OR UPDATE ON tutors
  FOR EACH ROW
  DECLARE
  BEGIN
     IF :new.tutorName = :old.tutorName
  THEN
      RAISE_APPLICATION_ERROR(-20101, 'A tutor with the same name currently exists.');
      ROLLBACK;
  END IF;
  END;
  /
  </code></pre>
  
  <p>This trigger is used to prevent users from entering the same tutor name at different records.</p>
  
  <p>After I insert two records with the same tutorname, the trigger does not block me from inserting it. Is there anyone can tell me what are the problems with this coding? Here are the sample format and insert values:</p>
  
  <pre><code>INSERT INTO tutors VALUES (tutorID, tutorName tutorPhone, tutorAddress, tutorRoom, loginID);
  
  
  INSERT INTO tutors VALUES ('13SAS01273', 'Tian Wei Hao', '019-8611123','No91, Jalan Wangsa Mega 2, 53100 KL', 'A302', 'TianWH');
  </code></pre>