The PUT_LINE procedure writes a specified number of characters to a file and adds a newline character.
The PUT_LINE procedure is similar to the PUT procedure, but adds a newline character after writing the data. The autoflush parameter specifies whether to immediately flush the written data to the file system.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
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 the FOPEN procedure. |
| buffer | The text buffer containing the line to be written to the file. |
| autoflush | If TRUE, the buffered data is written to disk. |
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONWRITE_ERROR
Considerations
If the maximum number of bytes is not specified in
FOPEN, the maximum size of the buffer parameter is 32767 bytes. The default value is 1024. The total of all sequential calls toPUTcannot exceed 32767 bytes without intermediate buffer flushes.If the file is opened in byte mode, the
INVALID_OPERATIONexception is raised.
