I tried searching over internet about the purpose,use and implementation of cursor in SQL.I found some answers they were very explained in very bookish type of language and the examples were way complicated to understand the function itself.I am new to database/SQL so can somebody please explain cursor with a simple example.
I tried searching over internet about the purpose,use and implementation of cursor in SQL.I
Share
At its simplest form a cursor is used to iterate over rows of a result set. Imagine a row as an object inside a list. With a cursor you have access to just that row.
If you’re familiar with a foreach loop in other coding languages you are accomplishing a lot of the same function.
This link wasn’t too bookish. Non Bookish Description