Read data from CLOB data type
How can I read the data in my 8k CLOB column ? This column has been created as 'inline' but since the size is >4K, I think it is stored offline.
All subprograms in dbms_lob package read the data as "(CLOB)" and give me the length as 6, rather than giving me the real data.
Any suggestions/comments ?
If you inserted data greater than 4k in size, then it got stored out-of-line. Are you saying that DBMS_LOB.GETLENGTH(<clob_column>) is showing 6K?
Have you tried to select * from <table_name>;
Anyway, if you want to read the CLOB from PL/SQL, the following should work:
CREATE OR REPLACE PROCEDURE readLOB_proc IS
Amount BINARY_INTEGER := 32767;
Position INTEGER := 1000;
SELECT <clob_column> INTO Lob_loc
Chunksize := DBMS_LOB.GETCHUNKSIZE(Lob_loc);
IF (Chunksize < 32767) THEN
Amount := (32767 / Chunksize) * Chunksize;
DBMS_LOB.READ (Lob_loc, Amount, Position, Buffer);
Last edited by ebrian; 05-09-2006 at 07:37 PM.
Click Here to Expand Forum to Full Width