PUT

2023-10-24 09:23:03  Updated

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.

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_FILEHANDLE

  • INVALID_OPERATION

  • WRITE_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 sequential PUT calls cannot exceed 32,767 without intermediate buffer flushes.

Contact Us