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

Home -> Community -> Usenet -> c.d.o.misc -> how can I check if a file exists with the UTL_FILE package

how can I check if a file exists with the UTL_FILE package

From: <erik_at_softman.com.pl>
Date: 1998/01/27
Message-ID: <885915762.1912995841@dejanews.com>#1/1

Hi,

I try to build some PL/SQL routines for FILE I/O. One of these routines is to check if a file exists. I wrote the following routine to achieve this but I run into some strainge error:

FUNCTION check_file (fpath IN VARCHAR2, ffile IN VARCHAR2) RETURN BOOLEAN IS file_handle UTL_FILE.FILE_TYPE; BEGIN file_handle := UTL_FILE.FOPEN(fpath, ffile, 'R'); RETURN UTL_FILE.IS_OPEN(file_handle); EXCEPTION WHEN OTHERS THEN RETURN FALSE; END; When I call this function with an existing file and the right path everything works without any problems. However, when I specify a file that doesn't exists I get the error ORA-03113 end-of-file on communication channel. For some strainge reason this error doesn't raise an exception and therefore I am not able to handle this error.

Does anybody have any idea why no exceptions are raised or what I am doing wrong?

Thanks in advance,

E.R. Toonen
Softman S.A. Piaseczno, Poland.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Tue Jan 27 1998 - 00:00:00 CST

Original text of this message

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