The FSEEK stored procedure is used to move the file access position in bytes.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
UTL_FILE.FSEEK (
file IN OUT UTL_FILE.FILE_TYPE,
absolute_offset IN PL_INTEGER DEFAULT NULL,
relative_offset IN PLS_INTEGER DEFAULT NULL);
Parameters
| Parameter | Description |
|---|---|
| file | The file handle. |
| absolute_offset | The starting position of the offset. The default value is NULL. |
| relative_offset | The length to move. A positive integer indicates moving forward; a negative integer indicates moving backward. |
Exceptions
INVALID_FILEHANDLEINVALID_OFFSETINVALID_OPERATIONREAD_ERROR
Considerations
You can directly read the first few lines of a file by using
FSEEK, without closing and reopening the file.For
relative_offset, if the specified number of bytes is reached at the beginning of the file, the file pointer will be placed at the beginning of the file. If the specified number of bytes is reached at the end of the file, theINVALID_OFFSETerror will be triggered.The file must be opened in
rmode; otherwise, theINVALID_OPERATIONexception will be triggered.
