O'Reilly logo

Oracle® PL/SQL® Interactive Workbook, Second Edition by Elena Silvestrova, Benjamin Rosenzweig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required