• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is real world uses of cursors?

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
What is real use of cursors, why we shuould have cursor in a select statement when we can return the rows without using cursors?

Thanks
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a cursor you can step through and process the rows in a ResultSet one by one.



In this not working code example you can process the Resultset with the help of a cursor one by one.
 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So when we are iterating over a resultset we are using a cursor, but it is implecit, that was something which i did not know.

Thanks
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!