Re: Puzzled: CURSOR in Package

From: jane <janeyiu_at_optonline.net>
Date: Tue, 20 Nov 2001 17:16:00 GMT
Message-ID: <kdwK7.164789$%94.29494383_at_news02.optonline.net>


Thanks, Conner , for your input.
[Quoted] I understand but I still can't help thinking: The exact SAME benefits you indicated.... can it not be achieved by simply put the WHOLE cursor declaration AND definition in the pkg spec as opposed just the cursor header in the pkg spec ?

I mean I can just modify the SQL in the spec and recompile and nothing else is affected, right ?
So this goes back to my original question. ie Putting the cursor in spec, that's good and well. But what I am wondering is why the SELECT in the body.

jane

[Quoted] "Connor McDonald" <connor_mcdonald_at_yahoo.com> wrote in message news:
> Its not about "hiding", its about modularity. You're publicising an
> object (a cursor in this case), and (hopefully) you're publishing this
> as an unchanging, guaranteed to be there definition. You're advertising
> the fact that to (say) "get a list of employees", this is the cursor to
> be used.
>
> You're protecting anyone that uses that cursor from the definition - it
> may be a query from EMP, it might be a join, it might (in 9i) be a
> PL/SQL routine that sends it results back via a pipelined clause...All
> of which you can add/change/implement/etc without a single line of code
> *outside* the package being needed.
Received on Tue Nov 20 2001 - 18:16:00 CET

Original text of this message