title: Error being thrown with trigger: ORA-20987: APEX - ORA-01858 ORA-06512
body: <p>I have been working on a trigger that counts the number of users when the table is modified.</p>
  
  <p>Tables:</p>
  
  <pre><code>SKN_ENJIN
  ID            NUMBER
  ENJIN_NAME    VARCHAR2(99)
  EMAIL         VARCHAR2(99)
  IP_ADDRESS    VARCHAR2(15)
  STATUS        NUMBER
  
  
  SKN_ENJIN_COUNT
  ID            NUMBER
  COUNT_DATE    DATE
  MEMBER_COUNT  NUMBER
  </code></pre>
  
  <p>Trigger</p>
  
  <pre><code>create or replace trigger "BI_SKN_ENJIN_COUNT_TG" 
    after insert or update or delete on "SKN_ENJIN"               
  
    DECLARE
    mCount    NUMBER;
    mDate     DATE;
  
  begin 
  
    select COUNT(ID) into mCount from SKN_ENJIN where Status = 1;
  
    select CURRENT_DATE into mDate from dual;
  
    MERGE INTO SKN_ENJIN_COUNT c
        USING (Select * from SKN_ENJIN_COUNT)
        ON (TO_DATE(c.Count_date, 'MM-DD-YYYY') = TO_DATE(mDate, 'MM-DD-YYYY'))
      WHEN MATCHED THEN
        UPDATE SET c.Member_count = mCount
      WHEN NOT MATCHED THEN
        INSERT (Count_date, Member_count)
        VALUES (mDate, mCount);
  end;
  </code></pre>
  
  <p>When I manually place data into the Object Browser, the triggers work fine.
  When I place the script into the SQL Commands, it also works...</p>
  
  <p>But when I place the same data in the app, I get this error:</p>
  
  <pre><code>Ajax call returned server error ORA-20987: APEX - ORA-01858: a non-numeric
  character was found where a numeric was expected ORA-06512: at 
  "SOKAN_MEMBER_DATA.BI_SKN_ENJIN_COUNT_TG", line 11 ORA-04088: error during
  execution of trigger 'SOKAN_MEMBER_DATA.BI_SKN_ENJIN_COUNT_TG' - Contact
  your application administrator. Details about this incident are available
  via debug id "835641798". for .
  </code></pre>