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 , 12 of 26


FILEISOPEN Function

This function finds out whether a BFILE was opened with the given FILE locator.

If the input FILE locator was never passed to the FILEOPEN procedure, then the file is considered not to be opened by this locator. However, a different locator may have this file open. In other words, openness is associated with a specific locator.

Syntax

DBMS_LOB.FILEISOPEN (
   file_loc   IN    BFILE)
  RETURN INTEGER; 

Pragmas

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

Parameters

Table 22-22 FILEISOPEN Function Parameter
Parameter  Description 
file_loc
 

Locator for the BFILE

Returns

INTEGER: 0 = file is not open, 1 = file is open

Exceptions

Table 22-23 FILEISOPEN 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. 

INVALID_OPERATION
 

File does not exist, or you do not have access privileges on the file. 

Example

CREATE OR REPLACE PROCEDURE Example_9 IS
DECLARE
    fil      BFILE;
    pos      INTEGER;
    pattern  VARCHAR2(20);
BEGIN
    SELECT f_lob INTO fil FROM lob_table 
        WHERE key_value = 12;
    -- open the file
    IF (dbms_lob.fileisopen(fil))
    THEN
        pos := dbms_lob.instr(fil, pattern, 1025, 6);
         -- more file operations
         dbms_lob.fileclose(fil);
   ELSE
        ; -- return error
    END IF;
END;

See Also:

"FILEEXISTS 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