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 - check for file existence?

Re: UTL_FILE - check for file existence?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 24 Jan 2001 20:54:21 -0800
Message-ID: <3A6FB17D.792A81D5@exesolutions.com>

> Is there some way of using the UTL_FILE package to check to see if a
> non-text file(.jpg) exists?

The following are the built-in exceptions for the UTL_FILE package:

exception
  when utl_file.invalid_mode then
    raise_application_error (-20051, 'Invalid Option');   when utl_file.invalid_path then
    raise_application_error (-20052, 'Invalid Path');   when utl_file.invalid_filehandle then
    raise_application_error (-20053, 'Invalid Filehandle');   when utl_file.invalid_operation then
    raise_application_error (-20054, 'Invalid operation');   when utl_file.read_error then

    raise_application_error (-20055, 'Read Error');
  when utl_file.write_error then
    raise_application_error (-20056, 'Write Error');
  when utl_file.internal_error then
    raise_application_error (-20057, 'Internal Error');

I would think that "Invalid Filehandle" or "Read Error" would do quite nicely. Just test out these operations in their own code block and handle the exception if it is generated.

Daniel A. Morgan Received on Wed Jan 24 2001 - 22:54:21 CST

Original text of this message

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