The PUT_LINE procedure writes a line followed by a line break of the specified size to a file.
PUT_LINE is basically the same as PUT, except that PUT_LINE puts a line break at the end of the line, and uses autoflush to automatically flush the line to the file system after each write operation.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
UTL_FILE.PUT_LINE (
file IN FILE_TYPE,
buffer IN VARCHAR2,
autoflush IN BOOLEAN DEFAULT FALSE);
Parameters
| Parameter | Description |
|---|---|
| file | The active file handle returned by an FOPEN call. |
| buffer | The text buffer that stores the line to be written to the file. |
| autoflush | Flushes data in the buffer to the disk if the value is TRUE. |
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONWRITE_ERROR
Usage notes
If you do not specify the maximum size in
FOPEN, the maximum size of the buffer parameter is 32,767 bytes. The default value is 1,024 bytes. The sum of all sequentialPUTcalls cannot exceed 32,767 without intermediate buffer flushes.If the file is opened in byte mode, the
INVALID OPERATIONexception will be raised.