Lab 15.1 Using Parameters with Cursors and for Update Cursors

Lab Objectives

After this Lab, you will be able to:

Use Parameters in a Cursor

Use a FOR UPDATE Cursor

Use the WHERE CURRENT OF Clause

Cursors with Parameters

A cursor can be declared with parameters. This enables a cursor to generate a specific result set, which is, on the one hand, narrow, but, on the other hand, reusable. A cursor of all the data from the ZIPCODE table may be very useful, but it would be more useful for certain data processing if it held information for only one state. At this point, you know how to create such a cursor. But wouldn’t it be more useful if you could create a cursor that could accept a parameter of a state and then run through only the city ...

Get Oracle® PL/SQL® Interactive Workbook, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.