Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Question about UTL_FILE

Question about UTL_FILE

From: Chris \( Val \) <chrisval_at_bigpond.com.au>
Date: Wed, 08 Jun 2005 04:33:12 GMT
Message-ID: <cyupe.7497$F7.3109@news-server.bigpond.net.au>


Hi everyone, I have a question about UTL_FILE that is driving me crazy - I just cannot get it to see the file.

Firstly the details:

I am using the Oracle 9ir2 personal edition, patched at: Release 9.2.0.6.0 on Win XP Pro.

My windows account is added to the "Administrator" group, as well as the "ORA_DBA" group, and visa versa.

My Oracle account has DBA, RESOURCE and CONNECT privileges.

I created a directory on my local HDD called: C:\OraTest

In Oracle, I then created the directory as follows:

CREATE DIRECTORY OraTest as 'C:\OraTest'

Directory created.

I then created the most simplest procedures I could think of:

create or replace procedure MyFileReader(

                  MyDir in varchar2, MyFile  in varchar2 ) as

  InFile utl_file.file_type;
  Buffer long;

begin

  InFile := utl_file.fopen( MyDir, MyFile, 'r' );

  exception
    when utl_file.invalid_path then
    dbms_output.put_line( 'ERROR: Invalid filename or path.' );

  utl_file.fclose( InFile );

end;
/

I then try:

exec MyFileReader( 'OraTest', 'OraFile.txt');

But I always get the "invalid_path" exception being thrown, and I can't figure out what I have missed?

I even went to the extent of adding a path directive to the "init.ora" file as many would suggest:

utl_file_dir=C:\OraTest

But that did not make a difference, and as far as I know, I think I read that this was not even necessary for my version of Oracle, right?

This is about the fifth time over a year that I have tried to get this working, and I am determined to see it through this time, as it really has me annoyed :-)

Any help appreciated.

Thanks,
Chris Val Received on Tue Jun 07 2005 - 23:33:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US