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.
 
Write the following When-Button-Pressed trigger code for the "Export To CSV" button:
 
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;
 

Writing Text File From A Tabular Block In Oracle Forms的更多相关文章

  1. Moving From Top To Bottom in Detailed Block in Oracle Forms

    Suppose you want to scan a tabular grid block (loop through all records in detail block) from top to ...

  2. Copy Records From One Data Block To Another Data Block In Oracle Forms

    In this tutorial you will learn to copy the records from one data block to another data block on sam ...

  3. Sort Detail Data Block Example - Oracle Forms

    Example is given below to sort detail data block data (toggle asc or desc) with push buttons used as ...

  4. Determining Current Block and Current Item in Oracle Forms

    SYSTEM.CURSOR_BLOCK Determining current block in Oracle Forms Using SYSTEM.CURSOR_BLOCK system varia ...

  5. Writing Text Files On The Client in Oracle Forms 10g

    Below is the example to write file on client in Oracle Forms 10g with webutil library package.Note:  ...

  6. 【转】shell脚本执行时报"bad interpreter: Text file busy"的解决方法

    1)问题现象: 在ubuntu下执行以下脚本( while_count),报错: -bash: ./while_count: /bin/bash: bad interpreter: Text file ...

  7. [转]Loading, Editing, and Saving a Text File in HTML5 Using Javascript

    本文转自:http://thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-htm ...

  8. shell脚本执行时报"bad interpreter: Text file busy"的解决方法

    在执行一个shell脚本时,遇到了“-bash: ./killSession.sh: /bin/bash: bad interpreter: Text file busy”错误提示,如下所示: [or ...

  9. eclipse的使用-------Text File Encoding没有GBK选项的设置

    eclipse的使用-------Text File Encoding没有GBK选项的设置 2013-12-25 09:48:06 标签:java myeclipse使用 有一个项目是使用GBK编码的 ...

随机推荐

  1. 【fedora】制作安装u盘

    找一台安装好linux系统的PC,将下载的LiveCD ISO文件复制到硬盘(这样速度快),查看U盘挂载的位置(用磁盘工具),在终端中使用dd命令: $ sudo dd if=<Live ISO ...

  2. Servlet概念框架

    以 Servlet 3.0 源代码为基础.Servlet 是 Javaweb 应用的基础框架,犹如孙子兵法之于作战指挥官,不可不知. 概念框架 机制: 事件 Event, 监听器 Listener 数 ...

  3. gerrit-git

    解释为什么gerrit中的push是需要用refs/for/master http://stackoverflow.com/questions/10461214/why-is-git-push-ger ...

  4. Java中main方面面试题

    1.不用main方法如何定义一个类? 不行,没有main方法我们不能运行Java类. 在Java 7之前,你可以通过使用静态初始化运行Java类.但是,从Java 7开始就行不通了. 2.main() ...

  5. [Android新手区] SQLite 操作详解--SQL语法

    该文章完全摘自转自:北大青鸟[Android新手区] SQLite 操作详解--SQL语法  :http://home.bdqn.cn/thread-49363-1-1.html SQLite库可以解 ...

  6. Docker centos 安装syslog

    在通常的Linux服务器中,有一些服务本身没有日志,只能通过 tail -f /var/log/messages来查看其运行日志,比如nrpe server.但是,如果想在docker容器中实现这个功 ...

  7. php curl语句的用法

    system32文件夹下,修改php.ini文件,找到;extension= php_curl.dll行,去掉前面的;号,保存,重启服务器.在站点目录下建立一个PHP文件,内容如下 $ch = cur ...

  8. Eclipse中Outline里各种图标的含义

    在使用Eclipse或者MyEclipse开发的时候,你一定看到过Outline和Package Explorer中小图标,很多刚刚接触编程的童鞋们可能不会在意它们代表的含义,但如果你花几分钟的时间了 ...

  9. 如何修改ECSHOP后台管理中心的Title信息

    下图中红色圈定的部分就是本次修改要改的地方 修改方法其实很简单的:打开语言包文件  /languages/zh_cn/admin/common.php 将 $_LANG['app_name'] = ' ...

  10. C++11 std::function用法

    转自 http://www.hankcs.com/program/cpp/c11-std-function-usage.html function可以将普通函数,lambda表达式和函数对象类统一起来 ...