Utl_file. FOPEN

Source: Internet
Author: User
Write to File:
1. Empowering Users with Database administrators
Create or replace directory path alias as ' path ';
Grant read, write on directory path alias to user;
GRANT EXECUTE on utl_file to user;
2. Call Write File
Declaring variables: V_myfilehandle utl_file. File_type;
Open file: v_myfilehandle: = Utl_file. FOPEN (' Path alias ', ' File name ', ' a '); --a Read and write files
Write to file: Utl_file. Put_Line (V_myfilehandle, ' Hello Again for the Second time! ' || To_char (sysdate, ' mm-dd-yy HH:MI:SS AM '));
OFF: Utl_file. FCLOSE (V_myfilehandle);

Utl_file. FOPEN (location in varchar2, filename in varchar2, Open_mode-varchar2) return file_type;
Location is the path parameter,
FileName is the filename,

Open_mode is open mode, ' R ' is read text, ' W ' is written text, ' A ' is an additional text, parameter is not case-sensitive, if you specify ' A ' but the file does not exist, it will be created with ' W ', ' W ' has the function of covering;


http://blog.csdn.net/cnham/article/details/5927700

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.