The FGETPOS function returns the current position (offset) of the file in bytes.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this function.
Syntax
UTL_FILE.FGETPOS (
file IN FILE_TYPE)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| file | The directory path of the source file. |
Return value
FGETPOS returns the relative offset of the opened file in bytes. If the file is not opened, an exception is thrown. If the file is opened in w mode, the return value is 0.
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONREAD_ERROR
Considerations
You must open the file in r mode. Otherwise, the INVALID_OPERATION exception is thrown.
