FOPEN procedure
Translation reference for UTL_FILE.FOPEN.
Last updated
Translation reference for UTL_FILE.FOPEN.
Last updated
This procedure opens a file. ()
This procedure is implemented using Snowflake to store the text files.
The user is in charge of uploading the local files to the to be used by the procedure.
The UTL_FILE
schema must be created.
Create the stage utlfile_local_directory
.
If the value in the OPEN_MODE
parameter is w or r it is necessary to upload the file in the utlfile_local_directory
.
FILENAME: The name of the file, including extension.
OPEN_MODE: Specifies how the file is opened.
w
Write mode
Supported
a
Append mode
Supported
r
Read mode
Supported
rb
Read byte mode
Unsupported
wb
Write byte mode
Unsupported
ab
Append byte mode
Unsupported
This procedure uses two tables with which the operation of opening a file will be emulated. The FOPEN_TABLES
table will store the files that are open and the FOPEN_TABLES_LINES
table stores the lines that each file owns.
If the file is opened in write mode, a new file is created, if it is opened in read or append mode, it loads the lines of the file in FOPEN_TABLES_LINES
and inserts the file in FOPEN_TABLES
.
Oracle
The user can modify the procedure if it is necessary to change the name of the stage.
LOCATION
parameter is not used.The LOCATION
parameter is not used now because the stage used in the procedure is static. It is planned for an updated version of the procedure to increase its extensibility by using this parameter to enter the name of the stage where the file you want to open is located.
MAX_LINESIZE
parameter is not used.OPEN_MODE
values supported.This procedure supports write (w), read (r), and append (a) modes to open files.
This procedure for now, only supports .CSV files.
SSC-FDM-OR0036: UnnecessaryBuiltInPackagesParameters
The command runs in .
The Oracle Built-in package procedure supports six modes of how to open the file, but only three of them are supported in the Snowscripting procedure.
These procedures are implemented for the internal stages in the
To run this example, see
The Oracle Built-in package procedure has the MAX_LINESIZE
parameter, but in the Snowscripting procedure it is removed because it is not used.
: CUSTOM UDF INSERTED.
: Data Type Not Recognized.