我使用 UTL_FILE 编写了一个程序:
CREATE OR REPLACE PROCEDURE UTL_CREATE_FILE
(
output_file in UTL_FILE.file_type,
log_file in UTL_FILE.file_type,
filename in VARCHAR2 (64),
ddate in VARCHAR2 (19),
sep in NVARCHAR2 (3)
)
IS
BEGIN
sep := Chr(9);
ddate := TO_CHAR (SYSDATE, 'YYYYMMDD');
filename := 'EXT' || ddate || '.dat';
output_file := UTL_FILE.fopen ('C:/home/S/', filename, 'w', 32000);
log_file := UTL_FILE.fopen ('C:/home/S/', 'WEEKLY.log', 'a', 32000);
UTL_FILE.put_line (log_file, TO_CHAR (SYSDATE, 'DD-MM-YYYY HH24:MI:SS') || 'Started with file ' || filename);
select 'HUGE SQL STATEMENT'|| sep || 'Anykey' as OUTLINE from DUAL;
UTL_FILE.put_line (output_file, OUTLINE);
UTL_FILE.fclose (output_file);
UTL_FILE.put_line (log_file, TO_CHAR (SYSDATE, 'DD-MM-YYYY HH24:MI:SS') || 'Finished for file ' || filename);
UTL_FILE.fclose (log_file);
END;
但 Toad 返回警告:已编译但存在编译错误。
有人可以帮助我吗?
因此,我想在 C:/home/S/ 目录中接收 EXT.DAT(和日志)。先感谢您。