title: IF-ELSE statement inside trigger in oracle
body: <p>Here are the columns in my table, <code>TB_KELUHAN</code> </p>
  
  <pre><code>"IDKELUHAN" NUMBER(20,0) NOT NULL ENABLE, 
  "NAMA" VARCHAR2(10 BYTE), 
  "IDUNIT" NUMBER(10,0), 
  "TGL_KELUHAN" DATE DEFAULT sysdate, 
  "KELUHAN" VARCHAR2(200 BYTE), 
  "STATUS" VARCHAR2(10 BYTE), 
  "IDPEGAWAI" NUMBER(10,0), 
  "TGL_SELESAI" DATE DEFAULT sysdate, 
  "ID_JENISKELUHAN" NUMBER(5,0), 
   CONSTRAINT "TB_KELUHAN_PK" PRIMARY KEY ("IDKELUHAN")
  </code></pre>
  
  <p>I want a trigger that will update a row's TGL_SELESAI column to SYSDATE, when a row's STATUS becomes 'SELESAI'. Here is the text of the trigger I've tried:</p>
  
  <pre><code>TRIGGER SELESAI
  AFTER UPDATE OF STATUS ON TB_KELUHAN
  FOR EACH ROW
  DECLARE 
     TGL_SELESAI DATE;
  BEGIN
     IF :new.STATUS = 'SELESAI'
     THEN 
        TGL_SELESAI:=SYSDATE;
     END IF;
  END;
  </code></pre>
  
  <p>When I change the value of STATUS to "SELESAI", the corresponding TGL_SELESAI did not change. Why?</p>