The FGETPOS function returns the current relative offset position within a file, in bytes.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
UTL_FILE.FGETPOS (
file IN FILE_TYPE)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| file | The directory that stores the source file. |
Return values
The FGETPOS function returns the accessed position (offset in bytes) in the open file. If the file is not opened, an error occurs. If the file is opened in w mode, 0 is returned.
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONREAD_ERROR
Considerations
The file must be opened in r mode; otherwise, the INVALID_OPERATION exception will be thrown.