FILEEXISTS v17

The FILEEXISTS procedure determines whether a BFILE exists.

FILEEXISTS(<file_loc> IN BFILE ) RETURN NUMBER

Parameters

file_loc

Locator for the BFILE.

Return value

ReturnDescription
1File exists
0Files does not exist

Example

DECLARE
   File_loc      BFILE := BFILENAME('ANOTHER_DIR', 'a.txt');
BEGIN
   /* See If the BFILE exists: */
   IF (DBMS_LOB.FILEEXISTS(File_loc) != 0)
   THEN
      DBMS_OUTPUT.PUT_LINE('BFILE exists');
   ELSE
      DBMS_OUTPUT.PUT_LINE('BFILE does not exist');
   END IF;
EXCEPTION
   WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Operation failed');
END;