title: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: " while executing code
body: <pre><code>for i in (select * from order_dtls order by 1 asc) loop
  
      select b.dealer_id
        into n_dealer
        from booking_mst b
       where b.booking_id = i.booking_id;
  
      dbms_output.put_line(n_cnt ||'--'|| to_char(sysdate,'yyyymmdd') ||'--'|| chr(1) || '43' ||'--'||
                           chr(1) || n_dealer ||'--'|| '1525' ||'--'|| '0' ||'--'|| i.amount ||'--'||
                           chr(1) || i.product_id ||'--'|| chr(1) || i.quantity ||'--'||
                           chr(1) || to_char(i.order_date,'yyyymmdd') + 1 ||'--'|| chr(1) ||
                           to_char(i.order_date,'yyyymmdd'));
  
      commit;
  
      n_cnt := n_cnt + 1;
  
    end loop;
  </code></pre>