Home » SQL & PL/SQL » SQL & PL/SQL » UTL FILE issue (9i)
UTL FILE issue [message #334880] Fri, 18 July 2008 09:07 Go to next message
kumar1234
Messages: 13
Registered: June 2008
Junior Member
Hi All,

I have an issue in writing flat file for more than 32767 bytes..

here is my source code.. please suggest ..Can it be modified that 32768th byte is written in next line and so on..

or any other approach

please help

declare
cursor c1 is  select XDATA from  t1 where
v2 CLOB;
v_file UTL_FILE.FILE_TYPE ;
count1 number :=1;
begin
v_file:=utl_file.fopen('DIR','F1','w',32767);
for c2 in c1
loop
count1 :=count1 +1;
v2:=c2.xdata.getclobval();
utl_file.put_line (v_file,v2);
end loop;
utl_file.fclose(v_file);
count1:= count1 -1;
end;


thanks a lot

[Updated on: Fri, 18 July 2008 09:33]

Report message to a moderator

Re: UTL FILE issue [message #334894 is a reply to message #334880] Fri, 18 July 2008 10:05 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
utl_file handles files greater than 32K bytes but not LINES greater than that.
So split your variable into string of that size.

By the way, instead of subtract one in the end, initialize your variable to 0.

Regards
Michel


Previous Topic: Have to create folder in server from client machine through procedure
Next Topic: Cursor is Out of Scope
Goto Forum:
  


Current Time: Sun Dec 04 00:09:50 CST 2016

Total time taken to generate the page: 0.08697 seconds