Oracle: convert LONG to VARCHAR2

SET serveroutput ON

DECLARE
s_sql VARCHAR2(2000);
s_rez VARCHAR2(32767);
BEGIN
s_sql := 'select LONG_COLUMN from SOME_TABLE where ID_COLUMN = 123' ;
EXECUTE IMMEDIATE s_sql INTO s_rez;

-- print it on the screen or convert/transform/search...
dbms_output.put_line ( s_rez ) ;

END;
Bookmark and Share

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>