title: how to insert the result of dbms_output.put_line to a table for error catch?
body: <pre><code>Exception
  WHEN OTHERS THEN
  --dbms_output.put_line('pl_update_sidm_user r: ERROR CODE:' || sqlcode || '~' || 
  --sqlerrm || ' EMPL_NBR:' || r.EMPL_NBR);
  
  insert into ERROR_MSG (ERROR_MSG_ID,ERROR_MSG) values (ERROR_MSG_ID_SEQ.NEXTVAL, 'pl_update_sidm_user_duty_role r2');
  END;
  </code></pre>
  
  <p>I would like to put the error result to a table.
  However, how can I do that?</p>
  
  <p>Can I put the result of <code>dbms_output</code> to a table as a string?</p>
  
  <p>If not, can I get the <code>sqlcode,sqlerrm</code> without using <code>dbms_output</code>?</p>
  
  <p>Thank you !!</p>