title: Oracle pl/sql Procedure to update table - exception handling
body: <p>This is my first query on PL/SQL and I did spend an hour trying to find answers on the net, anyway - here it goes.</p>
  
  <p>I'm writing a procedure to update a table and it all works fine, however when I typed in to update a <code>job_id</code> that doesn't exist, I expected my exception handling to tell me that the <code>job_id</code> is invalid, however I got no error message. </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE UPD_JOB(p_job_id jobs.job_id%TYPE, p_jobnew jobs.job_title%TYPE)
  IS
  BEGIN
  UPDATE JOBS SET job_title =p_jobnew WHERE JOB_ID = p_job_id;
  EXCEPTION
  WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('No rows have been updated');
  END;
  /
  </code></pre>
  
  <p>I then tried to update a job_id that I knew didn't exist to see if the exception works by typing the following</p>
  
  <pre><code>EXECUTE UPD_JOB('ABCXXX','WILL FAIL');
  </code></pre>