Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: UTL_FILE on client
in article gxi_5.4873$UN1.450880_at_newsread2.prod.itd.earthlink.net, Alika at lfam42_at_earthlink.net wrote on 12/14/00 11:06 PM:
> Bill,
>
> You can only right to the server box with the UTL_FILE package. The UTL_FILE
> package exists as a stored package in the database. You can execute the
> UTL_FILE package from the client box but UTL_FILE executes on the server
> box, and can only write to the server box. One more thing, you have to have
> add a entry to your INIT.ORA file specific for your instance. If I remember
> correctly it is:
>
> UTL_FILE_DIR = c:\MyDirectory
>
> You can specify any directory but UTL_FILE can only write to those
> directories unless you put a astrerik (*) like so:
>
> UTL_FILE_DIR = *
>
> This will allow UTL_FILE to write anywhere on the server box. However they
> don't recommend this because you could potential write over system or
> database specific files.
>
> The call to open it should look like:
>
> DECLARE
> file_h UTL_FILE.FILE_TYPE;
>
> BEGIN
> file_h := UTL_FILE.FOPEN('c:\MyDirectory','output.txt','a');
> UTL_FILE.PUTF(file_h,'WRITE SOME STUFF\n');
> UTL_FILE.FCLOSE(file_h);
>
> END;
>
> Hope this was helpful and not redundant,
>
> Alika
>
> Bill <wsprouse_at_my-deja.com> wrote in message
> news:91bkd3$kle$1_at_nnrp1.deja.com...
>> Hello all. >> >> I am trying to use the UTL_FILE package to write output to a file on a >> client computer. The client is NT 4.0, Oracle is on a Unix box and I am >> running the code in SQL*Plus on the client. The documentation seems to >> suggest I can use this package to write to files on the client - is this >> true? >> >> When I run the code the INVALID PATH exception is raised when I use the >> UTL_FILE.FOPEN. I am trying to direct the output to a directory and >> file on the NT client. >> >> Thanks in advance. >> >> Bill >> >> >> Sent via Deja.com >> http://www.deja.com/ >>
As usual, Oracle is cryptic in their error/exception codes. Your observation is greatly appreciated!
Ric. Received on Fri Dec 15 2000 - 22:30:45 CST
![]() |
![]() |