【发布时间】:2017-03-17 14:53:09
【问题描述】:
我需要从 Oracle APEX 应用程序中编写一个文本文件。 (4.2 版)我找到了下面的代码,但我不断收到错误 ORA-29280 无效目录路径。
指定的目录是我具有写入权限的目录。我在记事本中创建了一个文件并将其保存到此目录中。
也许我需要能够浏览输出目录。 APEX 是否有用于输出文件的文件浏览器?
你能告诉我什么?谢谢。
我的代码
Declare
v_input_record varchar2(600);
p_dir varchar2(200);
p_file varchar2(50);
l_output utl_file.file_type;
l_amt number default 32000;
cursor cur_go_thru_AD_INPUT
is select COUNTY_INPUT_RECORD
from ad_county_input_file
order by county_input_file_id_seq;
begin
p_dir := 'C:\Windows\Temp';
p_file := 'SoS-Output.asc';
l_output := utl_file.fopen(p_dir, p_file, 'w', 32767);
open cur_go_thru_AD_INPUT;
LOOP
FETCH cur_go_thru_AD_INPUT
INTO v_input_record;
EXIT WHEN cur_go_thru_AD_INPUT%NOTFOUND;
utl_file.put(l_output, v_input_record );
utl_file.fflush(l_output);
END LOOP;
utl_file.new_line(l_output);
utl_file.fclose(l_output);
结束;
【问题讨论】:
-
可能先尝试创建目录
标签: oracle oracle-apex