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: can I use a pl/sql cursor as subquery or in another cursor?

Re: can I use a pl/sql cursor as subquery or in another cursor?

From: Peter Mutsaers <plm_at_gmx.li>
Date: 13 Nov 2002 23:27:22 +0100
Message-ID: <87lm3xxfzp.fsf@muon.mutsaers.com>


>> "Jusung" == Jusung Yang <JusungYang_at_yahoo.com> writes:

    Jusung> Correct a bit on my previous post regarding the
    Jusung> "parameterized view".  Missed out on the SYS_CONTEXT. It
    Jusung> appears you can emulate the multi-parameter "parameterized
    Jusung> view" with SYS_CONTEXT. Basically for each parameter you
    Jusung> want to pass to the view you use dbms_session.set_context
    Jusung> to set it up in stead. And you create the view with the
    Jusung> multiple sys_context predicates. It seems you can even use
    Jusung> it SYS_CONTEXT to emulate "nested parameterized view". I
    Jusung> think you have to create a context for each layer of the
    Jusung> view. But, really...  The setup is long, and when you get
    Jusung> to this point, the results look to me like anything but a
    Jusung> paramterized view.

I tried using sys_context a while ago to pass such parameters, but I found it to be very clumsy, and obviously you're using sys_context for another purpose than it was intended to.

Also, it is very slow.

The view is a work around, but I don't like to have to create so many extra views just because pl/sql doesn't provide the facilities to build queries modularly.

I'm thinking more and more to drop pl/sql all together, and go 100% for dynamic sql using java clients. Building the query strings, you can use any modularization you like.

For more complex, not all too frequent queries, at least.

-- 
Peter Mutsaers, Dübendorf, Switzerland.
Received on Wed Nov 13 2002 - 16:27:22 CST

Original text of this message

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