Name
file_read_line, file_rl, file_rb, file_rlo, file_rlc, read_object, get_plaintext_row — read lines, bytes and serialized objects from files and sessions
Synopsis
varchar file_read_line(
|
in file varchar, |
in offset integer); |
any file_rl(
|
inout handle any, |
| in line_offset integer, | |
in max_len integer); |
any file_rb(
|
inout handle any, |
in length integer); |
any file_rlo(
|
in file varchar); |
integer file_rlc(
|
inout handle any); |
any read_object(
|
inout session any); |
varchar get_plaintext_row(
|
inout session any); |
Description
file_read_line reads a single line from
file starting at byte
offset, advancing the returned text up to the next
newline (which is consumed). Convenient for scanning configuration or log
files when only an offset-based seek is needed. Requires DBA privileges.
file_rl, file_rb,
file_rlo and file_rlc implement
a stateful file-line / file-buffer reading API:
: file_rlo open a file for line-oriented reading; returns a handle to be passed to
: file_rl / file_rb / file_rlc.
: file_rl read one line starting at <line_offset>, optionally bounded by <max_len>
: bytes (default 80 KiB).
: file_rb read exactly <length> raw bytes from the open handle.
: file_rlc close the open handle and free its resources. Returns 1 on success.
All four require DBA privileges. The handle returned by
file_rlo is an opaque file-descriptor box and must be
passed to file_rlc when reading is complete.
read_object deserialises one Virtuoso-format object
(anything that can be produced by serialize) from
session and returns it. Use it to read structured
payloads written by Virtuoso-internal RPC or file-format consumers.
get_plaintext_row reads a single tab-separated text
row from session and returns it as a string, with
the trailing newline stripped. Pairs naturally with bulk-load procedures
and CSV scanning.
See Also
file_open,
file_to_string,
file_to_string_output,
get_csv_row