Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: UTL_FILE on client

Re: UTL_FILE on client

From: Tom Leary <tleary1_at_uswest.net>
Date: Sun, 17 Dec 2000 06:00:31 -0800
Message-ID: <gU1%5.73$_q6.23925@news.uswest.net>

I'm not sure offhand, but I'd guess that error is Unhandled User Exception. The UTL_FILE packacge does not handle exceptions internally, so exceptions are raised backed to your application. For this reason it is best to encapsulate all UTL_FILE calls within a local block, i.e. -

Code
...
BEGIN
  UTL_FILE.PUT_LINE(File_Handle, 'Text') EXCEPTION
  WHEN ...OTHERS... THEN
      ...'Hey, UTL FILE Error: ' || SQLERR.... END...
Code
....

"Frederick C. Lee" <fclee_at_earthlink.net> wrote in message news:B660302A.1FA5%fclee_at_earthlink.net...
> 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/
> >>
> >
> >
> I've been freaking out over an ORA-06510 exception when I attempt to
 access
> a stored procedure/function with some UTL_FILE routines from a forms
> trigger. Upon reflection, I believe I don't get such exceptions when I
> don't have such routines.
>
> As usual, Oracle is cryptic in their error/exception codes. Your
> observation is greatly appreciated!
>
> Ric.
>
>
Received on Sun Dec 17 2000 - 08:00:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US