[QUOTE=ad;21979]Hi Goodhealth,

Thanks for the code snippet. It works... But one small issue... My long raw column contains data length > 32760 chars. In PL/SQL varchar2 variable I am able to declare MAXimum of 32760 chars. Can you give me a hint on how can we read the complete column ( I think we have data upto 1 GB ) for each row.

Is there a way to read LONG RAW column as chunks of 32760 characters ? If i can do that, then I can use UTL_FILE ( again imposes a limit of 1024 chars for each write) But if I can read from LONG RAW as chunks of 32760 characters I can probably use UTL_FILE procedures to dump it to a OS file after a sequence of SUBSTR().

Please let me know. In the mean time, have a great day !

Thanks
ad[/QUOTE]

Use substr to loop through in smaller chunks if the column is more than 32767. See the code below. It does not have looping logic. Needs to be added. Also, you need to concatenate and write to a file.

set serveroutput on size 256000000
declare
a varchar(32767);
cursor c1 is select idt_rec from ids_upd_sync_nsa;
begin
for r2 in c1 loop
a:=UTL_RAW.CAST_TO_VARCHAR2(substr(r2.idt_rec,2000));
dbms_output.put_line(a);
dbms_output.put_line(r2.idt_rec);
dbms_output.put_line(length(a));
end loop;
end;
/