Take the 2-minute tour ×
select  utl_raw.cast_to_varchar2(DCFILE) hexchar from T_FILE

ORA-00997: illegal use of LONG datatype

select  to_char(DOC_FILE) hexchar from T_DOC_FILE

ORA-00932: inconsistent datatypes: expected CHAR got LONG BINARY

My column type long raw, how to make selected varchar2 ?

share|improve this question
Maybe this will help: stackoverflow.com/questions/426079/… –  Janek Bogucki Apr 15 '10 at 11:58

1 Answer 1

Oracle introduced their LOB datatypes in version 8.0, well over a decade ago. LONG and LONG RAW have been deprecated since before the Millenium (in favour of CLOB and BLOB respectively) precisely because working with LONGs is a pain in the neck and LONG RAWs doubly so, as you are now finding.

What exactly are you trying to achieve? Your logic seems confused. LONG RAW is intended for storing binary data (images, documents, etc) so rendering it as text is unlikely to produce satisfactory results.

share|improve this answer

Your Answer


