declare
outfile utl_file.file_type;
begin
outfile := utl_file.fopen('LOCAL_TRANSFER_WJC', 'operlog_20140716.txt', 'W');
for rec in (select a.operatename,
b.username,
b.department,
a.stepdes,
a.operateobject,
a.operatetime
from mread.sup_operatelog partition(P_20140701) a,
mread.con_mcpadmin_info b
where a.operatename=b.useraccount) loop
utl_file.put_line(outfile,
rec.operatename || ',' || rec.username || ',' ||
rec.department || ',' || rec.stepdes || ',' ||
rec.operateobject || ',' || rec.operatetime || ',');
end loop;
utl_file.fclose(outfile);
end;
/
declare
*
ERROR at line 1:
ORA-29285: file write error
ORA-06512: at "SYS.UTL_FILE", line 148
ORA-06512: at "SYS.UTL_FILE", line 889
ORA-06512: at line 14
ireaddb2_sd$wc -l operlog_20140716.txt
29325 operlog_20140716.txt
能够导出数据,但是又出错,分析为某一行数据长度较长,超出默认缓存大小
将
outfile := utl_file.fopen('LOCAL_TRANSFER_WJC', 'operlog_20140716.txt', 'W');
修改为
outfile := utl_file.fopen('LOCAL_TRANSFER_WJC', 'operlog_20140716.txt', 'W', 32767);
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/692830/viewspace-1220442/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/692830/viewspace-1220442/