PL/SQL (MOSC)

MOSC Banner

reading CLOB issues

edited Jan 26, 2012 7:57AM in PL/SQL (MOSC) 2 commentsAnswered
I am trying to read back a CLOB but its breaking the records , can you please tell me what I am doing wrong or how to read the CLOB in original form ?

SQL> DECLARE
     lobloc CLOB;
     buffer VARCHAR2(32000);
     amount NUMBER := 3000;
     amount_in_buffer NUMBER;
     offset NUMBER := 1;
   BEGIN
     --Initialize buffer with data to be inserted
     SELECT html_file INTO lobloc  -- get LOB handle
       FROM test_clob
       WHERE id = 1001;
     dbms_lob.read(lobloc,amount,offset,buffer);
     --using length built-in function to find the length of the buffer
  2    3    4    5    6    7    8    9       amount_in_buffer := length(buffer);
     dbms_output.put_line(buffer);
     dbms_output.put_line(to_char(amount_in_buffer));

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center