|
|
Re: retrieve data from clob column [message #2132 is a reply to message #2016] |
Sun, 23 June 2002 21:31 |
Afif
Messages: 2 Registered: June 2002
|
Junior Member |
|
|
CREATE OR REPLACE PROCEDURE Test_CLOB
IS
/* Variable Declaration */
string2 CLOB ;
v_oraerr_code VARCHAR2(100) ;
v_oraerr_mesg VARCHAR2(100) ;
Buffer VARCHAR2(32767);
Amount BINARY_INTEGER := 32767;
Position INTEGER := 1;
len_lob INTEGER;
BEGIN
Proc_return_CLOB('500413806',string2);
len_lob := dbms_lob.GETLENGTH(string2);
Amount := 200;
dbms_output.put_line('v_status : ' ||v_status);
LOOP
dbms_lob.READ(string2,Amount,position,sqlstring);
dbms_output.put_line(sqlstring);
position := position + Amount;
IF ((position + 200) >= len_lob ) THEN
amount := len_lob - position;
END IF;
EXIT WHEN position >= len_lob;
END LOOP;
/*EXCEPTION
WHEN OTHERS THEN
v_oraerr_code := SQLCODE;
v_oraerr_mesg := SQLERRM;
dbms_output.put_line(v_oraerr_code);
dbms_output.put_line(v_oraerr_mesg);*/
END;
/
Execute thsi test procedure and you will see the O/p on SQL plus.
But execute SET SERVER OUT ON SIZE 1000000;
before.
|
|
|