首页 > 解决方案 > 文件路径无效

问题描述

我正在 TOAD 中测试以下代码。


create directory test_dir AS 'c:\';
DECLARE
  fileHandler UTL_FILE.FILE_TYPE;
BEGIN
  fileHandler := UTL_FILE.FOPEN('test_dir', 'test_file.txt', 'W');
  UTL_FILE.PUTF(fileHandler, 'Test writing to a file.\n');
  UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
  WHEN utl_file.invalid_path THEN
     raise_application_error(-20000, 'ERROR: Invalid PATH FOR file.');
END;  

它返回以下错误:

Error at line 1
ORA-20000: ERROR: Invalid PATH FOR file.
ORA-06512: at line 9

谁能告诉我如何解决这个错误?非常感谢!

标签: oracleplsqlutl-file

解决方案


推荐阅读