FOPEN function

The FOPEN function opens a file for I/O.

Syntax

UTL_FILE.FOPEN(location,filename,open_mode [ ,max_linesize ] )

Return value

This function returns a value of type UTL_FILE.FILE_TYPE that indicates the file handle of the opened file.

Function parameters

location
An input argument of type VARCHAR(128) that specifies the alias of the directory that contains the file.
filename
An input argument of type VARCHAR(255) that specifies the name of the file.
open_mode
An input argument of type VARCHAR(10) that specifies the mode in which the file is opened:
a
Append to file
r
Read from file
w
Write to file
max_linesize
An optional input argument of type INTEGER that specifies the maximum size of a line in characters. The default value is 1024 bytes. In read mode, an exception is thrown if an attempt is made to read a line that exceeds max_linesize. In write and append modes, an exception is thrown if an attempt is made to write a line that exceeds max_linesize. End-of-line characters do not count toward the line size.