Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle gurus..please help with UNION query
Alex Shnir wrote:
>
> Just like this:
>
> select int1, int2, char3, char4, int5, char6 from aaa
> UNION
> select int_01, 0, '', char_01, 0, 'aaaaaaaaaaaa' from bbb
>
> > Only make sure that your dummy is matching the datatype
Sometimes (especially in PL/SQL) you must do such trick :
SELECT date1, number1, char1, date2, number2 from AAA
UNION
SELECT to_date(NULL), to_number(NULL), to_char(NULL), sysdate, 10 from
BBB
If you do not specify explicit conversion your PL/SQL procedure
containing cursor with above SQL may cause ORA-600 during compilation.