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

Home -> Community -> Usenet -> c.d.o.misc -> Re: returning modified resultsets

Re: returning modified resultsets

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 9 May 2005 18:23:36 +0200
Message-ID: <427f8e44$0$286$626a14ce@news.free.fr>

"René Laursen" <rene_at_ssv.dk> a écrit dans le message de news:427f58c7$0$67261$157c6196_at_dreader2.cybercity.dk...
| How do I write a stored procedure that is returning only a subset of a
| resultset.
|
| I know I have to make a package and declare the result type as ref cursor
| when I want to return a resultset.
|
| But my problem is that I only want to return a subset of the resultset -
| where the condition for including (or excluding) is not possible to specify
| in the select statement.
|
| I want to do something like
|
| for
| select field_a,Field_b,Field_c from table
| into a,b,c
| do
| if somecondition then return (a,b,c)
|

It seems to you you can't specify the condition in the select statement maybe someone else can do it if you try to explain it.

Else you can have a look at table function, section "Accepting and Returning Multiple Rows with Table Functions" in Chapter 8 "PL/SQL Subprograms" of "PL/SQL User's Guide and Reference": http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/08_subs.htm#19677

Regards
Michel Cadot Received on Mon May 09 2005 - 11:23:36 CDT

Original text of this message

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