Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: fuction using view with union stops query
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.orgReceived on Sat Sep 15 2007 - 11:23:23 CDT