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: fuction using view with union stops query

Re: fuction using view with union stops query

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 15 Sep 2007 09:23:23 -0700
Message-ID: <1189873394.797576@bubbleator.drizzle.com>


jobs wrote:
> something else interesting... why can't i do this?
>
> select getani_fn(8406) x from dual
> union all
> select getani_fn(8393) x from dual
> union all
> select getani_fn(8605) x from dual
> union all
> select getani_fn(15267) x from dual
> union all
> select getani_fn(15177) x from dual
>
> returns nothing, and individual steps return a value.

Badly written function?

create or replace function getani_fn(n NUMBER) RETURN NUMBER IS begin

   return n;
end;

SQL> select getani_fn(8406) x from dual;

          X


       8406

SQL> select getani_fn(8406) x from dual

   2 union all
   3 select getani_fn(8393) x from dual    4 union all
   5 select getani_fn(8605) x from dual    6 union all
   7 select getani_fn(15267) x from dual    8 union all
   9 select getani_fn(15177) x from dual;

          X


       8406
       8393
       8605
      15267
      15177

SQL>

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sat Sep 15 2007 - 11:23:23 CDT

Original text of this message

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