When i write the following program, i am getting error like: DECLARE vInHandle UTL_FILE.file_type; vNewLine VARCHAR2(250); BEGIN vInHandle := UTL_FILE.Fopen ('D:', 'new.txt', 'R'); LOOP BEGIN UTL_FILE.get_line(vInHandle, vNewLine); dbms_output.put_line(vNewLine); END; END LOOP; UTL_FILE.fclose(vInHandle); END; Error:-DECLARE*ERROR at line 1:ORA-29280: invalid directory path ORA-06512: at "SYS.UTL_FILE", line 18 ORA-06512: at "SYS.UTL_FILE", line 424 ORA-06512: at line 5 Can anyone solve this.Thanks in advanceDeveloper.

Showing Answers 1 - 5 of 5 Answers

Maria Antony

  • Oct 14th, 2006
 

Hi,

If you like to access a file using UTL_FILE, you should modify your init.ora file. The file should include the directories which are allowed to be accessed while using UTL_FILE.

That is, if you like to create a file in 'D:' , you should have an entry in your init.ora file as mentioned below.

UTL_FILE_DIR='D:'

So, Just add this and try again.

Regards,

Maria Antony.

  Was this answer useful?  Yes

dev

  • Oct 17th, 2006
 

Hi Maria Antony,

Thanks for the reply.

I tried by giving UTL_FILE_DIR='D:' in the init.ora.71720061376 file.

but still it's having the same error.

please let me know the solution.

Thanks in advance.

Developer.

  Was this answer useful?  Yes

use these steps.

1 modify init.ora   add a line

        UTL_FILE_DIR='D:My_DIR'

2. login as system as sysdba

        shutdown immediate;

         startup pfile=<pfile path> like d:oracleadminorclpfileinit.ora

     oracle should startup

      create spfile from pfile;

if step 2 is not working then

alter sytem set utl_file_dir = 'd:my_dir' scope = spfile;

restart the system.

then try your programme.

create folder "my_dir" in d: drive( os level)

login system as sysdba

create direcotory my_dir as 'd:my_dir';

grant read, write on directory my_dir to scott;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions