Monday, June 15, 2015

Convert BLOB/CLOB Data to VARCHAR2

Convert BLOB Column to VARCHAR2 ...


SELECT TO_CHAR(DBMS_LOB.SUBSTR(QUERY_FILE, 4000, 1 )) QUERY_TEXT
FROM SQL_TEXT

WHERE UNIQUE_ID=:P2_UNIQUE_ID;

Convert CLOB Column to VARCHAR2 ...

SELECT UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(QUERY_FILE, 2000, 1 ) ) QUERY_TEXT
FROM SQL_TEXT

WHERE UNIQUE_ID=:P2_UNIQUE_ID;

1 comment: