Hello.
I'm outputting a flat file using the utl_file package.
I have something like:
This works. The problem, though, is that I only get about 1200 rows per second as an output rate. Takes about 3 1/2 hrs to output 12M records.
When I call some SQL from MS FoxPro and output to a flat file from FoxPro, it writes at a rate of about...anyway, I can write the same amount of data to disk in 37 min instead of 240 min (3 1/2 hr.).
In PL/SQL, of course, a varchar variable can be up to 32k long, so if my output record has a width of 150, I can output about 200 records per write instead of 1 per write. Would this improve my performance substantially?
Do you have any other suggestions?
Thank you.
-Mike Kemp
I'm outputting a flat file using the utl_file package.
I have something like:
Code:
create or replace procedure prc_OutputSomeThing as
cursor cur_somecur is
select col1,col2,col3,col4
from sometable;
vcOutput varchar2(500);
rwSomeCur cur_somecur%rowtype;
file_handle utl_file.file_type;
begin
open cur_somecur;
file_handle:=utl_file.fopen('d:\path','file.txt','w')
loop
fetch cur_somecur into rwSomeCur;
exit when cur_somecur%notfound;
vcOutput:=rpad(rwSomeCur.col1,20);
vcOutput:=vcOutput||rpad(rwSomeCur.col2,20);
vcOutput:=vcOutput||rpad(rwSomeCur.col3,20);
vcOutput:=vcOutput||rpad(rwSomeCur.col4,20);
utl_file.put_line(file_handle,vcOutput);
utl_file.fflush(file_handle);
end loop;
close cur_somecur;
utl_file.fclose(file_handle);
end prc_OutputSomething;
When I call some SQL from MS FoxPro and output to a flat file from FoxPro, it writes at a rate of about...anyway, I can write the same amount of data to disk in 37 min instead of 240 min (3 1/2 hr.).
In PL/SQL, of course, a varchar variable can be up to 32k long, so if my output record has a width of 150, I can output about 200 records per write instead of 1 per write. Would this improve my performance substantially?
Do you have any other suggestions?
Thank you.
-Mike Kemp