Search code examples
sqltype-conversionblobapexvarchar2

how to solve Data type BLOB can not be converted to varchar2


I have created in apex 5.1 a report with form in oracle apex 5.1 in which I have a BLOB column called 'LIEN'. And when I insert data in the table and run the application I get this error:

Data type BLOB can not be converted to VARCHAR2!

How can this be solved?


Solution

  • Blob is used for binary data, like image or other binary files.

    For textual long fields a Clob or NClob should be used.

    A binary representation in string should be used for Blob such as HEX or Base64.

    For Oracle there are several stored procedure, or functions for this purpose, such as rawtohex(COLUMN), utl_raw.cast_to_varchar2(utl_encode.base64_encode(COLUMN)) and some other.