title: How to re-raise pl/sql exception in exception handling block?
body: <p>I have the following procedure which is used by some applications:</p>
  
  <pre><code>procedure p1
  is
  begin
    bla bla bla;  
  end;
  </code></pre>
  
  <p>But there is no exception handling block. So applications were written according this feature.</p>
  
  <p>Now I need to log errors in p1. But it shouldn't affect applications that use this procedure.</p>
  
  <p>Something like this:</p>
  
  <pre><code>procedure p1
  is
  begin
    bla bla bla;
  
    exception when others then
      log_error(sqlcode, sqlerrm);
      raise_new_exception (sqlcode, sqlerrm);
  end;
  </code></pre>
  
  <p>In case of <strong>raise_application_error</strong> first parameter should be in range [-20000, -20999]. So if there raises exception no_data_found, it cannot raise this error.</p>
  
  <p>In case of <strong>exception_init</strong>, second parameter should not be variable. It must be numeric literal.</p>
  
  <p>PS: As temporary solution, I'm using <strong>execute immediate</strong></p>