title: Cant retrieve error from procedure in PL/SQL
body: <p>I'm starting to work with PL/SQL and learning how to write <code>procedures</code> and <code>exceptions</code> but I cant seem to grasp how to show an error.  The procedure is a simple one, its only supposed to do simple math as you can see below:</p>
  
  <pre><code>create or replace
  procedure get_simple_math
    (n_num1 in number,
     n_num2 in number,
     n_answer out number,
     n_err_code out number,
     n_err_msg out varchar2)
  as
  begin
    n_answer := (n_num1 / n_num2);
    dbms_output.put_line('Answer is '||n_answer);
  
    n_err_code := 0;
  exception
    when others
    then
      n_err_code := SQLCODE;
      n_err_msg := 'Error in get_simple_math '||SQLERRM;
      raise_application_error (-20002,n_err_msg);
  end get_simple_math;
  </code></pre>
  
  <p>As you can see its nothing fancy, but I cant for the life of me get the <code>block</code> to run:</p>
  
  <pre><code>set serveroutput on
  declare
    n_answer number := 0;
    n_err_code number;
    n_err_msg varchar2;
  begin
    get_simple_math(10,5,n_answer);
  end;
  </code></pre>
  
  <p>I'm assuming I need to declare the variables that are set to <code>out</code>, which is why they are there.  I also tried adding them to the <code>procedure</code> execute like:</p>
  
  <pre><code>get_simple_math(10,5,n_answer,n_err_code,n_err_msg);
  </code></pre>
  
  <p>But that didn't seem to do the trick, so I am just looking for some help in solving this problem.  Thanks in advance.</p>