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