我想将一些异常信息写入某个文件中,但是上面的错误
  file_handle := UTL_FILE.FOPEN('TMP', 'costexcp.txt', 'w',32767);
  v_excpinfo := '单据号:  '||Pi_sBillID||'  明细序号:  '||Pi_iSeq||'  异常原因:  没有成本,需要手工输入成本!';
  UTL_FILE.PUTF(file_handle, v_excpinfo||'\n');
  UTL_FILE.FCLOSE(file_handle);
代码如上,请教大家,问题怎样解决,谢谢!

解决方案 »

  1.   

    29283, 00000, "invalid file operation"
    // *Cause:  An attempt was made to read from a file or directory that does
    //          not exist, or file or directory access was denied by the 
    //          operating system.
    // *Action: Verify file and directory access privileges on the file system,
    //          and if reading, verify that the file exists.
      

  2.   

    楼上的,我是这样做的:
    1.在d盘创建了d:\testtmp目录
    2.用sys用户登录到数据库(ora9i):conn sys/orcl@eai01 as sysdba
    3.在sqlplus中运行create or replace directory TMP as 'd:\testtmp';
    4. 在sqlplus中运行grant read,write on directory TMP to public
    5.alter system set utl_file_dir='d:\testtmp' scope=spfile;
    然后重启了数据库,为什么还不行呢
    多谢!