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 -> Re: SQL decode question

Re: SQL decode question

From: Daniel Morgan <damorgan_at_exesolutions.com>
Date: Fri, 12 Apr 2002 21:59:50 GMT
Message-ID: <3CB758D5.A46F9BE2@exesolutions.com>


You can not do what you are trying to do with decode.

What I can't tell ... is what you are trying to do.

Daniel Morgan

Anton An wrote:

> 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 - 16:59:50 CDT

Original text of this message

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