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 -> Why not getting INVALID_PATH?

Why not getting INVALID_PATH?

From: Doug Cowles <dcowles_at_bigfoot.com>
Date: Tue, 21 Dec 1999 21:43:06 -0500
Message-ID: <38603ABA.E2B4CA13@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...

Received on Tue Dec 21 1999 - 20:43:06 CST

Original text of this message

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