title: Update same table after Insert trigger
body: <p>I am working on a product in which I have to send SMS to concerned person when someone waits for more than 15 minutes for being served.</p>
  
  <p>For that I have written a procedure that watches a table and stores <code>CUST_ID, CUST_CATEGORY, DURATION</code> in a separate table when the <code>Duration</code> exceeds 15. The table structure of this table is:</p>
  
  <p><strong>Some_Table</strong></p>
  
  <p><code>CUST_ID          CUST_CATEGORY          DURATION         SMS_STATUS</code></p>
  
  <p>I wrote a trigger as:</p>
  
  <p><strong>Trigger</strong></p>
  
  <pre><code>create or replace trigger kiosk_sms_trg 
  after insert on Some_Table 
  referencing new as new old as old
  for each row
  BEGIN 
  SMS_Proc@My_Server; --Procudure that generates SMS
  update Some_Table set status = 'Y' where id = (select max(id) id  from Some_Table where status = 'N'); --Update Table that SMS has been sent
  select 'Y' into :new.status from dual;
  END;
  </code></pre>
  
  <p>But it creates Mutation Problem. How do I resolve it? Any help would be highly appreciated. I'm using Oracle 11G.</p>