What WHERE CURRENT OF clause does in a cursor?

LOOP
SELECT num_credits INTO v_numcredits FROM classes
WHERE dept=123 and course=101;
UPDATE students
SET current_credits=current_credits+v_numcredits
WHERE CURRENT OF X;
END LOOP
COMMIT;
END;

Showing Answers 1 - 3 of 3 Answers

Swapnil

  • Jul 28th, 2005
 

indicates latest row fetched in cursor

  Was this answer useful?  Yes

g_sidhu

  • Feb 6th, 2008
 

The WHERE CURRENT OF clause is used to reference the current row from an explicit cursor.

  Was this answer useful?  Yes


When referencing the current row from an explicit cursor, we use                           'WHERE CURRENT OF'.  it allows us to apply updates and deletes to the row currently been addressed.

NOTE: The cursor must have been declared with the FOR UPDATE clause,so that the rows are locked on OPEN.



regards,

Aravind purohit

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions