Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle gurus..please help with UNION query

Re: Oracle gurus..please help with UNION query

From: Jarek Palka <jarek_at_kamsoft.com.pl>
Date: Tue, 20 Jul 1999 12:06:45 +0200
Message-ID: <37944A35.82B4A8A3@kamsoft.com.pl>


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.



Jaroslaw Palka <jarek_at_kamsoft.com.pl> P.I.KAMSOFT, Katowice tel. (+48 32) 255-59-93, 209-07-05, fax 209-07-15 POLAND Received on Tue Jul 20 1999 - 05:06:45 CDT

Original text of this message

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