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: Suresh Bhat <suresh.bhat_at_mitchell-energy.com>
Date: Wed, 22 Dec 1999 12:20:56 -0600
Message-ID: <qE884.1618$y3.67436@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 22 1999 - 12:20:56 CST

Original text of this message

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