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

Home -> Community -> Usenet -> c.d.o.misc -> SQL decode question

SQL decode question

From: Anton An <anton.an_at_oracle.com>
Date: Fri, 12 Apr 2002 11:47:10 -0700
Message-ID: <3CB72BAE.16CE663A@oracle.com>


Hi all,

I have a question regarding the decode function in SQL. I am trying to use it in the following way
select
  decode(Document.type, 'Long Text', Long_Document.long_text, 'Short Text', Short_Document.short_text, '')
 ...
from... where...;

The problem is that Long_Document.long_text is of type LONG, while Short_Document.short_text is of type VARCHAR2(2000). I know decode is expecting the parameters to have the same data type, so I was trying to use some conversion functions (like to_char). But I was still given "inconsistent datatype" error.

Any ideas?

Thanks in advance!

Anton


Received on Fri Apr 12 2002 - 13:47:10 CDT

Original text of this message

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