The PUT procedure writes the information in the input parameter buffer to the specified file.
PUT writes data to the buffer and does not directly refresh it to the file system. You need to manually call UTL_FILE.FFLUSH to complete this operation.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
UTL_FILE.PUT (
file IN FILE_TYPE,
buffer IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
| file | The file handle for writing the file. The file must be opened in w or a mode. |
| buffer | The input parameter for storing the data to be written. If the file is opened in w mode, the data is written at the current offset; if opened in a mode, the data is written at the end of the file. |
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONWRITE_ERROR
Considerations
If the maximum byte size is not specified in FOPEN, the maximum size of the buffer parameter can be 32767 bytes. The default value is 1024. The total size of all sequential PUT calls cannot exceed 32767 bytes, and there is no intermediate buffer refresh.
