SQL Script for read information from a CSV file in FTP Server

Source: Internet
Author: User

DECLARE W_file_path VARCHAR2 (4000): = ' xxif_input '; --all_directories.directory_name w_file_name VARCHAR2 (4000): = ' lcytest001.csv ';  --the file name W_file_exists BOOLEAN;  W_file_length Number (Ten) DEFAULT 0;  W_file_type Utl_file.file_type;  W_line VARCHAR2 (4000) DEFAULT NULL;  W_rec_count number: = 1;  W_block_size Binary_integer;  --TYPE Tbl_varchar2 is TABLE of VARCHAR2 (4000) INDEX by Binary_integer; Rec_record tbl_varchar2;                             BEGIN--fnd_global.apps_initialize (user_id = 1110, resp_id = 50683,  resp_appl_id = 222); --Utl_file.fgetattr (W_file_path, W_file_name, W_file_exists, W_  File_length, w_block_size);  IF not W_file_exists then Dbms_output.put_line (' The file was not exist! ');  END IF;  --IF w_file_length = 0 Then Dbms_output.put_line (' The file is empty! ');  END IF; --W_file_type: = Utl_file.fopEn (location = w_file_path, filename = w_file_name,  Open_mode = ' r ', max_linesize = 32767);    LOOP utl_file.get_line (W_file_type, W_line, 32767);    Dbms_output.put_line (' information is: ' | | w_line);    Rec_record (w_rec_count): = W_line;  W_rec_count: = W_rec_count + 1; END LOOP; EXCEPTION when No_data_found then Utl_file.fclose (W_file_type); END;

SQL Script for read information from a CSV file in FTP Server

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.