Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Puzzled: CURSOR in Package

Re: Puzzled: CURSOR in Package

From: Mark Styles <news_at_lambic.co.uk>
Date: Tue, 20 Nov 2001 17:30:04 GMT
Message-ID: <ed4lvtknem3765ka6fpcb4f6c451897lt4@4ax.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US