Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help! returning filtered recordsets from oracle stored Proc
In article <9ptjfn$b54$1_at_news.vsnl.net.in>, "angshu" says...
>
>Hi All,
>
>I want to write a stored proc in Oracle8i which will return
>me recordsets. I think I can do it in a couple of ways 1)
>Reference cursor
>2) By creating a package in which I can declare the out
>parameters as "Table of DataType". And returning the values
>through a call to procedure of the package, right? If I use
>the 2nd approach I can't use a select statement to get
>recordsets .. Can I?
>
>But what I want to do is that I want to write a stored
>procedure from which I will retrieve recordsets but only
>after filtering the innitial recordsets by certain
>conditions ..
>
>say if in the stored proc I get the initial recordset as
>-----------
>Col1 Col2
>----------
>1 2000
>2 5002
>3 2394
>4 1309
>....
>.....
>----------
>
>Now this recordset will further undergo many filtering
>processes depending upon values fetched through many values
>by other SQLs in the procedure ... and finally what I would
>like to get is ...
>-----------
>Col1 Col2
>----------
>1 2000
>4 1309
>----------
>
>And I would like to get the resultant recordsets by just
>calling a single SQL statement like
>select * from MyStoredProc( .. parameters );
>
>Is this possible anyway? Can show me the light or mention
>where I can get to see any light?
for how to do this.
>THT
>regards
>~angshu
>
>
>
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Wed Oct 10 2001 - 08:10:16 CDT