utl_file.fopen Parameters in Oracle

  • PLSQL
  • 1 min read

In Oracle utl_file.fopen is a function, which opens a file on the server by returning its file handle. Function utl_file.fopen parameters in Oracle are as follows:

utl_file.fopen Syntax

UTL_FILE.FOPEN (
location IN VARCHAR2,
filename IN VARCHAR2,
open_mode IN VARCHAR2,
max_linesize IN BINARY_INTEGER) 
RETURN file_type;

utl_file.fopen Examples

1. utl_file.fopen in Write Mode Example

UTL_FILE.fopen ('OUTDIR',
'mytextfile.csv',
'w',
1000);

2. utl_file.fopen in Read Only Mode Example

UTL_FILE.fopen ('OUTDIR',
'mytextfile.csv',
'r',
1000);

Reference:

Oracle Utl_File.fopen

See also:

  1. The full example of UTL_FILE to Write File
  2. Read file using UTL_FILE in Oracle
  3. Import CSV file in Oracle Efficiently