如何以oracle形式使用TEXT_IO打开直接CSV文件? [英] How to open direct CSV file using TEXT_IO in oracle forms?
本文介绍了如何以oracle形式使用TEXT_IO打开直接CSV文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在触发器WHEN-BUTTON-PRESSED上以oracle形式10g应用了此代码.此代码仅将文件保存在目标位置.
I applied this code in oracle forms 10g on trigger WHEN-BUTTON-PRESSED. This code only save the file on target location.
代码:
PROCEDURE GEN_EXCEL IS
IN_FILE TEXT_IO.FILE_TYPE;
VC_HEAD Varchar2(32000);
vc_file_path Varchar2(50) := 'C:\';
BEGIN
IN_FILE := TEXT_IO.FOPEN(vc_file_path||'Test'||'.CSV','W');
TEXT_IO.PUT_LINE(IN_FILE,'YOUR_TITLE'||chr(10));
VC_HEAD := 'header1,header2,header3,header4';
TEXT_IO.PUT_LINE(IN_FILE,VC_HEAD);
FOR C1 IN ( SELECT column1, column2, column3, column4
FROM Table_name)
LOOP
TEXT_IO.PUT_LINE(IN_FILE,C1.col1||','||C1.col2||','||C1.col3||','||C1.col4);
END LOOP;
TEXT_IO.FCLOSE(IN_FILE);
MESSAGE('Excel file has been created!');
MESSAGE('Excel file has been created!');
EXCEPTION
WHEN Others THEN
TEXT_IO.FCLOSE(IN_FILE);
MESSAGE('Error while writing file.');
MESSAGE('Error while writing file.');
END;
我想要在按下按钮时直接从oracle表单中打开CSV文件
I want when-button-pressed then direct open CSV file from oracle forms
如何实现这个目标?
推荐答案
您可以使用webutil来做到这一点.
它具有功能client_host
.
You can use webutil to do this.
It has a function client_host
.
也可以将pause
放在第一封邮件后,而不是重复发送邮件.然后,您不需要第二条消息即可弹出消息.
Also instead of duplicating your messages you can put pause
after the first message. Then you don't need the second message for a popup of the message.
这篇关于如何以oracle形式使用TEXT_IO打开直接CSV文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文