The PUT procedure writes the data of input parameters in the buffer to the specified file.
The PUT procedure does not write data to the file system, but to a buffer. You need to manually call UTL_FILE.FFLUSH to flush it to the file system.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
UTL_FILE.PUT (
file IN FILE_TYPE,
buffer IN VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
| file | The file handle of the file to which data is to be written. The file must be opened in w or a mode. |
| buffer | Stores the input parameters whose data needs to be written to the file. If you open the file in w mode, the write begins at the offset position in the file. If you open the file in a mode, the write begins at the end of the file. |
Exceptions
INVALID_FILEHANDLEINVALID_OPERATIONWRITE_ERROR
Considerations
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 sequential PUT calls cannot exceed 32,767 without intermediate buffer flushes.