title: NO DATA FOUND in loop cursor
body: <p>I got 'No data found' error when I ran the following codes in PLSQL. </p>
  
  <pre><code> declare
  
      v_firm_id number;
      amount number;
  
      begin
  
      OPEN MT_CURSOR FOR
      SELECT firm_id
      FROM t_firm;
  
      LOOP
  
      FETCH MT_CURSOR INTO v_firm_id;
  
      EXIT WHEN MT_CURSOR%NOTFOUND;
  
      Select sum(TRN_AMOUNT) into amount 
      from t_sales
      where FIRM_ID = v_firm_id;
  
      update t_firm
      set matching_amount = amount
      where firm_id = v_firm_id; 
  
      END LOOP;
  
  
   end;
  </code></pre>
  
  <p>Anything wrong with this codes? Could anyone let me know the correction? Thanks!</p>