|
REF cursors are different than your typical, standard
cursors. With standard cursors, you know the cursor's
query ahead of time. With REF cursors, you do not have
to know the query ahead of time. REF cursors let you
create a cursor to be used in your PL/SQL block, for
instance, and use that cursor, without knowing ahead
of time what your particular query might be. This is
often used when the cursor's query will be given to a
stored procedure or function at runtime. For instance,
you might want a function to compute the average of a
column on a particular table. But you don't know ahead
of time what the table or column will be. With regular
cursors, you would need to know. But with REF cursors,
you can pass the table and column to the function, and
have the REF cursor build the cursor "on the fly".
For More Information
|