Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL function in a SELECT statement
Bruno Pennec wrote:
I think you'd better write something like:
SELECT column1 FROM table1 WHERE my_function(column2) = 1
And your function should look like:
FUNCTION my_function(p_column2 IN table1.column2%TYPE) RETURN NUMBER
IS
BEGIN
IF p_column2 IN (value1, value2, ..., valuen) THEN
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
Marc
>
> 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 Thu Sep 24 1998 - 00:36:09 CDT
![]() |
![]() |