Cursors are known for fetching row one by one fom a table.Actually they work just like as For-loop or while-Loop. Cursor always fetch one record at a time.
A cursor allows us to iterate a set of rows returned by a query and process each row accordingly.
Actually we should not use cursors because they degrade performance of database and also uses lots of server resources.ecause if there are lakhs of rows and cursor is manipulating each row one by one then definitely it will slow the performance of database.
We always write Cursors inside stored procedure.
Asked In: Many Interviews |