title: Why do i get the "ORA-06512" error and how do i remove it?
body: <pre><code>CREATE OR REPLACE TRIGGER trg_week_day
  BEFORE 
      INSERT OR UPDATE OR  DELETE
  ON emp
  BEGIN 
      IF (TO_CHAR(SYSDATE, 'DY') = 'SAT' OR TO_CHAR(SYSDATE, 'DY') = 'SUN') 
           THEN 
           raise_application_error(-20000,'User: ' ||user ||' May not change employee table during the weekend.'); 
         else
          dbms_output.put_line('Today is not Weekend, Let us Work');
          END IF; 
  END;
  /
  
  UPDATE emp
  SET sal = 32000
  WHERE empno= 101;
  </code></pre>
  <p>I get the following error</p>
  <blockquote>
  <p>Trigger created.</p>
  <p>ORA-20000: User: APEX_PUBLIC_USER May not change employee table during the weekend.<br />
  ORA-06512: at &quot;SQL_XDFWSAJBEIBDLNRPNGQWTGKQO.TRG_WEEK_DAY&quot;, line 5<br />
  ORA-06512: at &quot;SYS.DBMS_SQL&quot;, line 1721</p>
  </blockquote>
  <p>Edit 1: I need to create a trigger on emp table before insert update or delete command is done on emp table on weekend.
  i understand the ORA-20000: error</p>
  <p>but I don't understand how to remove the ORA-06512: and what is it about...
  Understanding the below comments I get that it is because of unhandled exceptions...is there a way to resolve it? in this code</p>
  <p>Thank everyone for the help.</p>