The IS_OPEN function checks whether a file handle is still open, which is often used to decide whether to call FCLOSE in case of an exception.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
UTL_FILE.IS_OPEN(file)
Parameters
| Parameter | Description |
|---|---|
| file | The active file handle returned by the FOPEN function. |
Return value
The IS_OPEN function returns a value of the BOOLEAN type. If the return value is TRUE, the file handle is valid and the corresponding file is open. If the return value is FALSE, the file is closed or the file handle is invalid.
Considerations
- The file handle passed to
IS_OPENmust be obtained from a successful call toFOPENorFOPEN_NCHAR. An uninitialized or released handle will cause the function to returnFALSE. - Unlike most procedures in the
UTL_FILEpackage,IS_OPENdoes not typically raise an exception. Its design purpose is to safely query the status, so it will returnFALSEinstead of an error even if the handle is invalid.
