1 Reply Latest reply: Feb 12, 2013 8:19 AM by François Degrelle RSS

    utl_file.fopen gives invalid_path

    516162
      Hi,

      We have Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production.

      I need to read txt file from db package. File is located on my local machine. I use utl_file package and as I found I need to create a logical directory which points to physical one.
      'Create or replace' command doesn't work from my db package, it gives mi ORA-22929. But it works from SQL.

      CREATE OR REPLACE DIRECTORY v_dir AS 'C:\ab\cd';
      GRANT READ ON DIRECTORY v_dir TO PUBLIC;

      Even after creating logical directory in ALL_DIRECTORIES table, I'm getting INVALID_PATH error after command:

      srcFile := utl_file.fopen('C:\ab\cd','my.txt', 'R');

      where src file is declared as utl_file.file_type.

      After reading numerous forums and documentation I couldn't find a solution.

      At first, why 'Create or replace' command doesn't work from db package and then how to overcome INVALID_PATH error?

      Any help?


      Tnx,
      Nati