Friday, August 17, 2018

Oracle PLSQL Cursor Duplicate of final Record

Oracle PLSQL Cursor Duplicate of final Record


loop
 fetch s_cur into s_rec;
 exit  when s_cur%notfound;
  dbms_output.put_line('id:'||s_rec.id||':name:'||s_rec.name);
end loop;
When you have fetched the last record and trying to fetch the next s_cur%notfoundbecomes true but before it has a chance to exit from loop you are outputting the last record once again.

No comments:

Post a Comment

AWS how to delete VPC when it has error with Network interface , Gateway decencies

   how to delete VPC when it has error with Network interface , Gateway decencies  in AWS 1. Check if it is running on EC2 instance then Sto...