Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL decode question
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