-
Expert Member
Error while creating a text file
While creating a text file using utl_file it is showing error message ora-29280: invalid directory path
I have set the path in init.ora in server as
utl_file_dir = 'd:\orahome\bin'
This is procedure code
create or replace procedure test_filehandling as
filehandle utl_file.file_type;
writemessage varchar2(200);
begin
filehandle := utl_file.fopen('\\10.15.1.197\d\orahome\bin','test.txt','w');
writemessage := 'this is created for testing purpose \n' || ' \n this is the second line';
utl_file.putf(filehandle,writemessage);
writemessage := ' line by line code using putline';
utl_file.put_line(filehandle,writemessage);
utl_file.fflush(filehandle);
utl_file.fclose(filehandle);
end;
/
could anyone suggest me what is wrong with the code?
Last edited by krishnaindia2007; 01-05-2008 at 03:05 AM.
-
Expert Member
Re: File input/output in Pl/Sql
To check Directory name,directory path use this query
select directory_name , directory_path from all_directories
To create Directory name use this query
CREATE OR REPLACE DIRECTORY TEST_UTIL AS 'C:\TEMP'
use directory name in place of \\10.15.1.197\d\orahome\bin
ex: filehandle := utl_file.fopen('test_util','test.txt','w'); Then ur procedure will work
Last edited by susarlasireesha; 01-05-2008 at 05:47 AM.
-
Expert Member
Re: File input/output in Pl/Sql
Thank you for you suggestion. Now I am getting error
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 449
ORA-29283: invalid file operation
ORA-06512: at "PAYLIVE.TEST_FILEHANDLING", line 9
and 9th line in my code is
FILEHANDLE := UTL_FILE.FOPEN('TEST_UTIL','TEST.TXT','W');
Could you suggest what might be the problem?
-
Expert Member
Re: File input/output in Pl/Sql
The problem was solved. In server C Drive is not in shared mode.
-
Expert Member
Re: File input/output in Pl/Sql
Can't we give directly existing folder path like this
\\10.15.1.197\D\MYFOLDER
without creating a directory as
CREATE OR REPLACE DIRECTORY TEST_UTIL AS 'C:\TEMP'
I tried but once again it is showing message ORA-29280: invalid directory path.
What is the reason?
-
Re: File input/output in Pl/Sql
oracle refers to the virtual directory created not to system directory.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules