执行时若系统卡死再次执行 会报ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 475错误, 但是清空目录后有可以正常运行
这是核心逻辑 有部分删减
declare cursor c_sc_retdata is
select t.mer_code||'`'||t.busi_type msg from tc_agent_pay t
BEGIN
v_file_handle:=utl_file.fopen('JHTDATA',v_file,'W');
for v_retdata in c_sc_retdata loop
if v_iloop= 0 then
v_iloop := 1;
end if;
utl_file.put_line(v_file_handle,v_retdata.msg);
END LOOP;
utl_file.fClose(v_file_handle);
end;