web analytics

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;

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=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.