Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)

Part Number A89852-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

DBMS_LOB , 10 of 26


FILEEXISTS Function

This function finds out if a given BFILE locator points to a file that actually exists on the server's filesystem.

Syntax

DBMS_LOB.FILEEXISTS (
   file_loc     IN    BFILE)
  RETURN INTEGER; 

Pragmas

pragma restrict_references(FILEEXISTS, WNDS, RNDS, WNPS, RNPS);

Parameters

Table 22-17 FILEEXISTS Function Parameter
Parameter  Description 
file_loc
 

Locator for the BFILE

Returns

Table 22-18 FILEEXISTS Function Returns
Return  Description 
0
 

Physical file does not exist. 

1
 

Physical file exists. 

Exceptions

Table 22-19 FILEEXISTS Function Exceptions
Exception  Description 
NOEXIST_DIRECTORY
 

Directory does not exist. 

NOPRIV_DIRECTORY
 

You do not have privileges for the directory. 

INVALID_DIRECTORY
 

Directory has been invalidated after the file was opened. 

Example

CREATE OR REPLACE PROCEDURE Example_7 IS
    fil BFILE;
BEGIN    
    SELECT f_lob INTO fil FROM lob_table WHERE key_value = 12;
    IF (dbms_lob.fileexists(fil)) 
    THEN
        ; -- file exists code
    ELSE
        ; -- file does not exist code
    END IF;
    EXCEPTION
        WHEN some_exception
        THEN handle_exception;
END;

See Also:

"FILEISOPEN Function"


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback