Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT...INTO and UNION query
try to use the NVL functions.....
e.g.
select E, B, C
into var1, var2, var3
from
(select nvl(A,' ') as E, B,C
from .....
where....
union all
select nvl(D,' ') as E, B,C
from .....
where....);
Mike Heisz wrote in message ...
>I am having trouble with the fillowing type of statement
>
>select E, B, C
>into var1, var2, var3
>from
> (select A as E, B,C
> from .....
> where....
> union all
> select D as E, B,C
> from .....
> where....);
>
>For some reason var1 is being set to null but var2 and var3 are getting the
>correct values.
>
>It works if I use the following query but I would prefer not to do this:
>
>select *
>into var1, var2, var3
>from
> (select A, B,C
> from .....
> where....
> union all
> select D, B,C
> from .....
> where....);
>
>Any help would be appreciated,
>
>Thanks
>Mike
>
>
Received on Sun Aug 01 1999 - 11:45:43 CDT