1
Reply

Where you will use the cursor in the database ?

    Cursor is a variable which stores the results returned by a query.

    We use cursor in order to perform a row by row operation on that result set.
    Using cursors we can do any kind of manipulations for that result set.
    For ex:
    Consider a table Salary(empid, deptid, salary)
    If you decided to increase the salaries of employees % wise depending upon their salary, we need to go for row by row operations to calculate the percentage growth value.
    One possible way is to use cursor here.
    There are many other alternate ways also
    Prefer not to use cursors frequently ... as it degrades the performance
    Thank you