• Post author:
  • Post category:PLSQL
  • Reading time:1 mins 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:

Advertisement

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:

Advertisement
  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
Related:  DBMS_SCHEDULER Job Run Every Hour Example

Vinish Kapoor

An Oracle Apex Consultant, Oracle ACE, and founder of foxinfotech.in and orclqa.com a question and answer forum for developers.