The FGETATTR stored procedure is used to read and return the attributes of a disk file.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Syntax
UTL_FILE.FGETATTR(
location IN VARCHAR2,
filename IN VARCHAR2,
fexists OUT BOOLEAN,
file_length OUT NUMBER,
block_size OUT BINARY_INTEGER);
Parameters
Parameter |
Explanation |
|---|---|
| location | The directory where the source file is located, that is,ALL_DIRECTORIESIn the view,DIRECTORY_NAME(capitalization sensitive). |
| filename | The name of the file to be checked. |
| fexists | Whether the file exists. |
| file_length | File length, in bytes. If the file does not exist, returnNULL. |
| block_size | File system block size, in bytes. If the file does not exist, returnNULL. |
Usage instructions
The FGETATTR function is used to retrieve information about a file, such as its existence, size, and file system block size, without opening the file. The location must be the name of a directory object that has been created using CREATE DIRECTORY and for which the current user has access permissions.
