Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UTL_FILE Help - ORA-29280
"Randy Harris" <randy_at_SpamFree.com> wrote in message
news:_q03e.13157$ZB6.4109_at_newssvr19.news.prodigy.com...
>
> I don't know about 10g, but in 8i and 9i both, the utl_file_dir must be
> set.
> You won't be able to write to a file without having set it.
>
>
Yes. I would try the following
CONN SYSTEM/MANAGER_at_ORCL AS SYSDBA
CREATE DIRECTORY UTL_FILE_DIR AS as '/home/oracle/pdl_reports';
GRANT READ,WRITE ON DIRECTORY UTL_FILE_DIR TO SCOTT;
CONN SCOTT/TIGER_at_ORCL
CREATE OR REPLACE PROCEDURE rpts_mapping_engine IS
v_fh utl_file.file_type;
BEGIN
v_fh := utl_file.fopen(location => 'UTL_FILE_DIR',
open_mode => 'w');utl_file.put_line(file => v_fh, buffer => 'Test.html'); utl_file.fclose(file => v_fh);
exec rpts_mapping_engine;
Regards
Hex
> "Jonathon" <jsuggs_at_gmail.com> wrote in message
> news:1112314311.467309.130340_at_z14g2000cwz.googlegroups.com...
>> I am having some troubles trying to create a procedure that will create
>> an output file. When I try to use fopen, it gives me an error saying
>> "invalid directory path." I had seen a previous group talking about
>> this, tried their suggestions and am still having issues. I tried
>> creating a directory, no luck...where does the utl_file_dir come into
>> play? Does that have to be set for this to work? I have tried
>> everything, even setting chmod 777 on the directory. Open to any
>> suggestions.
>>
>> Here is my code:
>>
>> CREATE OR REPLACE PROCEDURE rpts_mapping_engine() IS
>> v_fh utl_file.file_type;
>> BEGIN
>> v_fh := utl_file.fopen(location => '/home/oracle/pdl_reports',
>> filename => 'test.html',
>> open_mode => 'w');
>> utl_file.put_line(file => v_fh, buffer => 'Test');
>> utl_file.fclose(file => v_fh);
>> END rpts_mapping_engine;
>>
>
> I don't know about 10g, but in 8i and 9i both, the utl_file_dir must be
> set.
> You won't be able to write to a file without having set it.
>
>
> --
> Randy Harris
> (tech at promail dot com)
>
>
Received on Fri Apr 01 2005 - 01:54:01 CST
![]() |
![]() |