Re: Using Union with different data types

From: Sagi <sag1rk_at_yahoo.com>
Date: 28 Nov 2002 09:30:50 -0800
Message-ID: <54d80104.0211280930.10f32dc7_at_posting.google.com>


skandu_at_yahoo.com (Srinivas) wrote in message news:<c6a7eae9.0211271114.7d27da2c_at_posting.google.com>...
> Thanks to all of you who responded. The solution works but there is a
> risk that if the data in clob exceeds the no. of characters then, we
> might encounter an error. Better would have been to be able to
> convert varchar to CLOB.
>
> However, I have read in the Oracle 9i Application Developer's Guide
> that Union with CLOB's is also not allowed.
>
> Select clobcol1 from tab1 union select clobcol2 from tab2 is also not
> allowed.
>
> thanks, once again

Hi,

I think you did not try properly.

I have checked it myself. It works. I dont know which version of 9i you are using. But i think it should work with 9.0.1. For your information i tried on 9.0.2

Anyway here is what i did:

CREATE TABLE T (X VARCHAR(30) ) ; CREATE TABLE T1 (Y CLOB); INSERT INTO T VALUES ('God Is Great') ;

INSERT INTO T1 VALUES ('I Believe in Him') ;

COMMIT ; SELECT X FROM T
UNION
SELECT TO_CHAR(Y) FROM T1 ; This works. Let me know after you check for yourself.

Regards,
Sagi Received on Thu Nov 28 2002 - 18:30:50 CET

Original text of this message