Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Package Cursor Question
E Richard Leiman & Eva wrote:
> Dear Daniel,
>
> Hi.
>
> No, it was not to populate a block with a ref cursor.
>
> It's my guess that the cursor in the package can only be called from a
> procedure, or function in that package.
>
> Can you tell me if there is an advantage to creating the cursor as shown in
> the book, or simply creating a cursor in the global area of the package?
>
> > If I understand where you are heading it can not be done. If the intent is
> to
> > populate a datablock use a REF CURSOR as the OUT parameter from a
> procedure.
> >
> > Daniel Morgan
> >
> >
Where a cursor is defined bears on two things ... scope and security.
If you define it in a procedure it is only visible within that procedure. If you define it in the package header it is available globally ... with obvious security implications.
I would consider it most likely a case of bad design to define a cursor in a package header. Leaving open the possibility that some specific design might make it useful.
Daniel Morgan Received on Fri Mar 28 2003 - 10:26:50 CST