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

Home -> Community -> Usenet -> c.d.o.server -> Re: REF cursors vs. cursors

Re: REF cursors vs. cursors

From: Jake <jgarfield_at_earthlink.net>
Date: Sun, 11 Nov 2007 15:31:37 -0800
Message-ID: <1194823897.337593.52710@v2g2000hsf.googlegroups.com>


On Nov 7, 4:25 pm, DA Morgan <damor..._at_psoug.org> wrote:
> Jake wrote:
> > With cursors I could define a lot of my queries in the package
> > specification. This is a convenient way to put queries in one place.
> > The parameterized cursor idea is nice too. Plus it helps in not
> > writing the same query many times throughout the code.
>
> > What if I would like to do a similar thing, but I need to use REF
> > CURSORS strictly for the ability to be able to pass the ref cursor to
> > a procedure. What's the preferred way of defining queries when using
> > REF CURSORS if I wanted to have a similar effect?
>
> > For example: Would it be feasible to define many VARCHAR2s that
> > represent queries in one package? Or is there a way to associate REF
> > CURSORS with a regular cursor that's defined in a package?
>
> > What would be the preferred way to do this?
>
> > thanks.
>
> Strongly or weakly typed?
>
> If weakly typed just use sys_refcursor and be done with it.
> --
> Daniel A. Morgan
> University of Washington
> damor..._at_x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org

well, i guess it's not so much which one to use. what I was meaning to ask was, how to get the benefits of cursors (i.e. using parameters, using a package to catalog your SQL), when you must use cursor variables for the purposes of passing to procedures. Received on Sun Nov 11 2007 - 17:31:37 CST

Original text of this message

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