Writing Text File From A Tabular Block In Oracle Forms
原创QUANWEIRU 博主文章分类:Oracle EBS Form ©著作权
©著作权归作者所有:来自51CTO博客作者QUANWEIRU的原创作品,请联系作者获取转载授权,否则将追究法律责任
The example given below for writing text file or CSV using Text_IO package from a tabular block in Oracle Forms.
Suppose there is a tabular grid data block "Job_History" in your forms and you want to write a CSV on click of a button by reading whole block from top to bottom. The following is the demo screen shot:
You can also download this form from this link Job_History_Csv.fmb.
Declare
out_file text_io.file_type;
v_line varchar2(1000);
begin
out_file := text_io.fopen('C:\job_history.csv', 'w');
go_block('job_history');
-- move control to first record;
first_record;
loop
v_line := :job_history.employee_id||','|| :job_history.start_date||','|| :job_history.end_date ||','||
:job_history.job_id||','|| :job_history.department_id;
text_io.put_line(out_file, v_line);
-- move control to next record;
if :system.last_record = 'TRUE' then
exit;
end if;
next_record;
end loop;
text_io.fclose(out_file);
-- again after completion move control to first record
first_record;
end;
上一篇:Reading Csv Files with Text_io in Oracle D2k Forms
下一篇:Changing Icon File Of Push Button At Runtime In Oracle Forms 6i
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章