17,377
社区成员
发帖
与我相关
我的任务
分享
declare
v_file_handle utl_file.file_type%rowtype; --句柄
v_cnt number(5);
v_iloop int;
V_msg varchar2(100);
cursor c_sc_retdata is
select t.mer_code||'`'||t.busi_type msg from tc_agent_pay t;
BEGIN
v_iloop := 0;
v_file_handle:=utl_file.fopen('JHTDATA',v_file,'W');
open c_sc_retdata;
loop
fetch c_sc_retdata into V_msg;
exit when c_sc_retdata%notfound;
if v_iloop= 0 then
v_iloop := 1;
end if;
utl_file.put_line(v_file_handle,V_msg);
END LOOP;
close c_sc_retdata;
utl_file.fClose(v_file_handle);
end;