Search notes:

Oracle: UTL_FILE.FOPEN

declare
   fh  utl_file.file_type;
begin
  
   fh := utl_file.fopen(
            location     => 'THE_DIRECTORY',
            filename     => 'the-file.txt',
            open_mode    => 'r',
            max_linesize =>  32767              -- Default is 1024
   );

OPENMODE

The value of open_mode can be set to
r to read text
w to write text (creates file)
a to append text (create file if it doesn't exist)
In addtition, a b can be appended to these three values to indicate byte mode.

See also

utl_file

Index