title: Update a table by using cursor
body: <p>Hi I'm Unable to update column in <code>jobs_new</code> table from <code>jobs</code> table by using a cursor even I got correct output in <code>dbms_output</code>. It is updating that column with same value below is the code and please help.</p>
  
  <pre><code>SET SERVER OUTPUT ON;
  
  DECLARE
    CURSOR c_emp IS
      SELECT
        a.job_id,
        a.max_salary,
        b.job_id
      FROM jobs a, jobs_new b
      WHERE
  
    a_jobid VARCHAR2(100);
    b_jobid  VARCHAR2(10);
    l_salary NUMBER;
  BEGIN
  
    OPEN c_emp;
  
    LOOP
      FETCH c_emp INTO a_jobid, l_salary, b_jobid;
      -- enter code here
      EXIT WHEN c_emp%NOTFOUND;
  
      UPDATE jobs_new
      SET max_salary = l_salary
      WHERE b_jobid = a_jobid;
  
      dbms_output.put_line(l_salary);
    END LOOP;
  
    CLOSE c_emp;
  END;
  /
  </code></pre>