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. java 网络编程(三)---TCP的基础级示例

    下面是TCP java网络编程的基础示例: tcp传输:客户端建立过程的思路:1.创建TCP客户端的Socket服务,使用的是socket对象,建议在创建的过程中,就明确了目的地和要连接的主机2.如果 ...

  2. EXCEL 删除重复项并保留最大最小值

    自定义排序 框选需要主次排序的区域 开始—排序和筛选—自定义排序 添加筛选条件 若要获取最小值则次要关键字选择升序 排序后的数据 删除重复项 数据—删除重复项 选择要删除的列 删除A列的重复项后,B列 ...

  3. crontab 误区

    # For details see man 4 crontabs# Example of job definition:# .---------------- minute (0 - 59)# | . ...

  4. 互联网公司前端初级Javascript面试题

    互联网公司前端初级Javascript面试题 1.JavaScript是一门什么样的语言,它有哪些特点?(简述javascript语言的特点)JavaScript是一种基于对象(Object)和事件驱 ...

  5. Sublime Text 3 常用插件以及安装方法

    安装Sublime Text 3插件的方法: 一.直接安装 安装Sublime text 2插件很方便,可以直接下载安装包解压缩到Packages目录(菜单->preferences->p ...

  6. altera soc体验之旅 FPGA与ARM的窃窃私语

      喜大普奔,公司要评估用SOC做产品,我就自然而然的被安排了学习和评估的工作,于是,每天的工作就是开始研究soc了.其实,只要能静下心来学习,一切都还是能够弄出来的. 以前像个无头苍蝇一样到处乱撞, ...

  7. 第一个应用程序HelloWorld

    iOS7 Beta已经发布了,迫不及待地下载了iOS 7及Xcode 5并体验了一下.先做一个简单的Hello World看看都有哪些变化吧.1. 启动Xcode5-DP:2. 从菜单选择File-N ...

  8. 在Ecshop后台打印订单页面将商品按货号排序

    ECSHOP后台管理里的“打印订单" 页面里的商品排序有点乱,现在想改成按序号来排序,修改方法如下 下面是在2.7.2基础上做的修改 打开 admin/order.php  文件 找到(大约 ...

  9. python:Xml

    <data> <country name="Liechtenstein"> <rank updated="yes">2< ...

  10. ACM题目————棋盘问题

    Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子 ...