Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Puzzled: CURSOR in Package
On Sun, 18 Nov 2001 03:42:37 GMT, "jane" <janeyiu_at_optonline.net>
wrote:
>In Steve Feuerstein's book on package cursors,
>he talks about declaring cursors in package
>specifications like:
>
>CURSOR my_cur RETURN xxxx ;
>
>and put the SELECT in the body...
>
>but he doesn't say why this "should" be the way.
>Is this just for standard good practice ? What else ?
It means you are encapsulating the cursor code, so it becomes a black box to other developers. That code can change at any time, and as long as the spec doesn't change, other code can carry on using it.
Put the code in the spec, and you have to recompile the spec if it changes, which causes invalidated objects and other problems.
I haven't actually used the above syntax, I tend to encapsulate further by having public functions and procedures which reference the private cursor. Received on Tue Nov 20 2001 - 11:30:04 CST
![]() |
![]() |