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: PL/SQL function in a SELECT statement

Re: PL/SQL function in a SELECT statement

From: Lío <jgonzalezsuareNO_at_SPAMnexo.es>
Date: Sat, 26 Sep 1998 02:03:28 GMT
Message-ID: <360c3c3c.2001137@news.mad.ibernet.es>


I think the PL/SQL Functions purpose is to return a single value (although it can have out parameters, this is a bad programming tecnique).

Can't you do something like this?
SELECT column1 FROM table1 WHERE my_function(column2);

(where my_function is a return boolean function).

I'm not sure you can use a boolean in the where clause of an SQL statement. If not, you can return a number (0=false, 1=true) or return the 'TRUE' / 'FALSE' string. Something like: SELECT column1 FROM table1 WHERE my_function(column2) = 'TRUE';

El Wed, 23 Sep 1998 16:52:30 +0200, Bruno Pennec <Bruno.Pennec_at_der.edfgdf.fr> escribio:

>I need to do a SELECT statement like :
>
> SELECT column1 FROM table1 WHERE column2 in my_function;
>
>( where my_function is a PL/SQL function. )
>
>My_function must return a list of items.
>What type must i use for the result of "my_function" ?
>(for example : column2 is a varchar2)
>
>best regards,
>
> bruno
Received on Fri Sep 25 1998 - 21:03:28 CDT

Original text of this message

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