Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: UTL_FILE Problem
UTL_FILE will write files to the machine on which Oracle is installed, and not to the local machine that accesses Oracle as a client. Also, the UTL_FILE_DIR parameter needs to be set in the init.ora.
<cldubois_at_my-deja.com> wrote in message news:8q5oqt$4fp$1_at_nnrp1.deja.com...
> In article <8ntshr$2u7q$1_at_www.univie.ac.at>,
> "Christian Kurz" <kurz_at_ani.univie.ac.at> wrote:
> > Hi!
> >
> > I want to create textfiles stored on my local computer. The should
contain
> > various data from my Oracle 8 Database. But it wont work and I dont
know
> > why. I would be thankfull for any suggestions. The path exists on my
local
> > Win2000 machine.
> >
> > Thanks
> >
> > Christian
> >
> > SQL> ru
> > 1 DECLARE
> > 2 TYPE GenericCurTyp IS REF CURSOR;
> > 3 c1 GenericCurTyp;
> > 4 sess_rec stat_tab%ROWTYPE;
> > 5 value NUMBER;
> > 6 cumpercent NUMBER;
> > 7 filehand UTL_FILE.FILE_TYPE;
> > 8 buffer VARCHAR2 (100);
> > 9 BEGIN
> > 10 filehand := UTL_FILE.FOPEN ('C:\Daten\Output\', 'test1.txt',
> > ); -- The problem seems to be to open the file
> > 11 OPEN c1 FOR
> > 12 SELECT * FROM stat_tab ORDER BY value;
> > 13 LOOP
> > 14 FETCH c1 INTO sess_rec;
> > 15 EXIT WHEN c1%NOTFOUND;
> > 16 value := .....
> > 17 cumpercent := .....
> > 18 buffer := to_char(value) || ' ' ||
> > to_char(cumpercent);
> > 19 UTL_FILE.PUT_LINE (filehand, buffer);
> > 20 END LOOP;
> > 21 CLOSE c1;
> > 22 UTL_FILE.FCLOSE (filehand);
> > 23 COMMIT;
> > 24* END;
> > DECLARE
> > *
> > ERROR at line 1:
> > ORA-06510: PL/SQL: unhandled user-defined exception
> > ORA-06512: at "SYS.UTL_FILE", line 98
> > ORA-06512: at "SYS.UTL_FILE", line 157
> > ORA-06512: at line 10
> >
> >
> >