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

Home -> Community -> Usenet -> c.d.o.tools -> Re: return cursor from a function and use it in an other statment

Re: return cursor from a function and use it in an other statment

From: Michael Bialik <michael_bialik_at_my-deja.com>
Date: 2000/07/08
Message-ID: <8k7a2o$9fh$1@nnrp1.deja.com>#1/1

Hi.

  1. You can use packages and package variables to return CURSOR.
  2. In your case it is NOT necessary ( you can NOT return cursor from function and to use that function inside SQL statement ).

    Try rewriting your SQL - use JOIN instead of IN ( SELECT ... ) :

    select some,data,a,b

     From table, othertable
     where  some = 1 And  table.data = othertable.otherdata ...

 HTH. Michael.

In article <3k8bmskl50p7v5vdri6s30q30105rssn24_at_4ax.com>,   belspar_at_voila.fr wrote:
> hi all
>
> my problem is that i have a function which retrieve me lot of data in
> a cursor :
>
> myfunction(Aparam in integer) return refcursortype ;
>
> and I want to use it in a select statment like :
>
> select some,data,a,b
> From table
> where some = 1 And data in (myfunction(1)) ;
>
> today i must use this statment :
>
> select some,data,a,b
> From table
> where some = 1 And data in (select ... from othertable where
> otherdata in selec( ...)) ;
>
> and i use it lot of time with different parameters , so I want to
> create a function.
> I think the "select" in the "where" has the same type as the cursor
> returned by my function no ??
> i use oracle 8i enterprise
>
> thanks a lot for help
>
> NB: sorry for my poor english , I'm french
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Jul 08 2000 - 00:00:00 CDT

Original text of this message

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