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

Home -> Community -> Usenet -> c.d.o.server -> Re: Why not getting INVALID_PATH?

Re: Why not getting INVALID_PATH?

From: Onno M. van der Straaten <ovds_at_casema.net>
Date: Wed, 29 Dec 1999 08:48:54 +0100
Message-ID: <3869c849$0$16266@reader3.casema.net>


The variable UTL_FILE_DIR in INIT.ORA must also be set to the include that particular directory.

"Suresh Bhat" <suresh.bhat_at_mitchell-energy.com> wrote in message news:qE884.1618$y3.67436_at_insync...
> Doug,
>
> I had a similar problem once before. I think it is the read/write
> permission problem.
>
> UTL_FILE package writes files under the ownership of UNIX user oracle.
Make
> sure the directory has permission to read/write for user oracle.
>
> Later !!!
>
> Suresh Bhat
> Oracleguru
> www.oracleguru.net
>
> Doug Cowles <dcowles_at_bigfoot.com> wrote in message
> news:38603ABA.E2B4CA13_at_bigfoot.com...
> > Small piece of code utilizing UTL_FILE package.
> > I'm trying to open up a file that does not exist -
> > and I am getting - through use of an OTHERS handler
> > SQLCODE=1
> > SQLERRM=User defined exception.
> > I haven't defined any exceptions.
> > I'm wondering why I don't get "Invalid_path"
> > Remember..the file is non-existent
> > Here's the code
> >
> > create or replace procedure foo as
> > location VARCHAR2(30) :=/home/dropship
> > filename VARCHAR2(30;
> > open_mode VARCHAR2(30):='r';
> > handle UTL_FILE.FILE_TYPE;
> > v_error_code NUMBER;
> > v_error_msg VARCHAR2(250);
> > BEGIN
> > filename:='Non existant';
> > handle:=utl_file.fopen(location,filename,open_mode);
> > EXCEPTION
> > WHEN UTL_FILE.INVALID_PATH
> > THEN dbms_output.put_line('Invalid Path');
> > WHEN OTHERS
> > THEN
> > v_error_Code := SQLCODE;
> > v_error_msg := substr(SQLERRM,1,250);
> > dbms_output.put_line(sqlcode||' '||sqlerrm);
> > dbms_output.put_line('Others excetion handler ');
> > END;
> >
> > Now when I run this - why do I get
> >
> > SQL> exec foo;
> > 1 User-Defined Exception
> > Others exception handler
> >
> > PL/SQL procedure successfully completed.
> >
> > Shouldn't I get Invalid Path?
> > And if not Invalid path, why user defined? I didn't define anything...
> >
> > - Dc.
> >
>
>
Received on Wed Dec 29 1999 - 01:48:54 CST

Original text of this message

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