The PUT procedure writes the information in the input parameter buffer to the specified file.
PUT writes data to the cache only and does not directly refresh it to the file system. You must manually call UTL_FILE.FFLUSH to complete the operation.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL-compatible mode.
Syntax
UTL_FILE.PUT (
file IN FILE_TYPE,
buffer IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
| file | The file handle for the file to be written. The file must be opened in w or a mode. |
| buffer | The input parameter used to save the data to be written. If the file is opened in w mode, the data is written at the current offset of the file. If the file is 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 is 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.