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 d开发者_如何学Catatypes: expected CHAR got LONG BINARY
My column type long raw, how to make selected varchar2 ?
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.
精彩评论