真的是郁闷!搞了半天,还是报一样的错误:invalid file operation!
procedure 如下:
create or replace procedure add_to_file is
handle utl_file.file_type;
begin  
  handle:=utl_file.fopen('PCTEST0','cc.txt','A');
  utl_file.put_line(handle,'only a test ');
  utl_file.fclose(handle);
end add_to_file;其中:PCTEST0 是一路径别名。 已经我的用户已经具有对其读写的权限。怪哉 。。何解????在线等。

解决方案 »

  1.   

    我按照你的写法试了一下没有问题
    create or replace DIRECTORY dir as 'c:\';
    grant read,write on DIRECTORY  dir to user;
    用USER登陆
    create or replace procedure add_to_file is
    handle utl_file.file_type;
    begin
      handle:=utl_file.fopen('DIR','c:\test.txt','A');
      utl_file.put_line(handle,'only a test ');
      utl_file.fclose(handle);
    end add_to_file;然后
    SQL> execute add_to_file;
     
    PL/SQL procedure successfully completed
    文件已经有了数据
      

  2.   

    试了没有问题,估计是你的PCTEST0有问题