FCLOSE procedure
Translation reference for UTL_FILE.FCLOSE.
Description
This procedure closes an open file identified by a file handle. (Oracle PL/SQL UTL_FILE.FCLOSE)
This procedure is implemented using Snowflake STAGE to store the written text files.
This procedure requires to be used in conjunction with:
UTL_FILE.FOPEN
procedure
Syntax
Setup data
The
UTL_FILE
schema must be created.
If you want to download the file, run the following command.
The GET command runs in Snowflake CLI.
Custom procedure overloads
UTL_FILE.FCLOSE(VARCHAR)
Parameters
FILE: Active file handler returned from the call to
UTL_FILE.FOPEN
Functionality
This procedure uses the FOPEN_TABLES_LINES
table created in the UTL_FILE.FOPEN
procedure.
This procedure writes to the utlfile_local_directory stage all lines with the same FHANDLE
from the file in FOPEN_TABLES_LINES
.
Note:
Note that this procedure uses the stage that was created previously. For now, if you want to write the file in another stage, you must modify the name.
These procedures are implemented for the internal stages in the
COPY INTO
Usage example
Oracle
To run this example, see ORACLE UTL_FILE
Snowflake
Known Issues
1. Modify the procedure for changing the name of the stage.
The user can modify the procedure if it is necessary to change the name of the stage.
2. Location static.
The location used to write to this procedure is static. A new version of the procedure is expected to increase its extensibility by using the location that has the FILE
parameter.
5. Files supported.
This procedure for now, only writes .CSV files.
Last updated