Hi All,
I have a table having CLOB column. I am reading CLOB and printing details into a concurrent program output using below code. Now problem is while reading LOB on loop it's skipping LOB data i.e.
Reading from 1-10000 then skipping 10001-19999 again reading 20000-29999 skiping 30000-39999.
Please suggest why its happening.
DECLARE
c CLOB;
PROCEDURE print_clob (p_clob IN CLOB)
IS
v_offset NUMBER DEFAULT 1;
v_chunk_size NUMBER := 10000;
BEGIN
LOOP
EXIT WHEN v_offset > DBMS_LOB.getlength (p_clob);
DBMS_OUTPUT.put_line (
DBMS_LOB.SUBSTR (p_clob, v_chunk_size, v_offset));
v_offset := v_offset + v_chunk_size;
END LOOP;
END print_clob;
BEGIN
FOR i IN 1 .. 10000
LOOP
c := c || 'test';
END LOOP;
print_clob (c);
END;