Cursor in SQL

We can say that cursor is row pointer in a set of rows (result set).Which points a single row at time in result set. But can move to other rows of the (result set) when required.

 To use cursor in SQL Store procedures. You need to follow the given steps.
  1.  Define a cursor
  2. Open the cursor to establish the result set
  3. Fetch the data into local parameter  as needed from the cursor.(one row at a time)
  4. Close the cursor when done.

No comments:

Post a Comment