GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 104 of 171    Print  
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 advance
Developer.

  
Total Answers and Comments: 3 Last Update: December 04, 2006     Asked by: developer 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 14, 2006 12:37:36   #1  
Maria Antony        

RE: When i write the following program, i am getting e...

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.


 
Is this answer useful? Yes | No
October 17, 2006 09:54:09   #2  
dev        

RE: When i write the following program, i am getting e...

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.


 
Is this answer useful? Yes | No
December 04, 2006 13:56:31   #3  
rampratap409 Member Since: September 2006   Contribution: 111    

RE: When i write the following program, i am getting e...

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;


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape