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(10) 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 is 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的更多相关文章

  1. SQL Script for select data from ebs and make a csv file to FTP

    DECLARE CURSOR cur_lcy_test IS SELECT rcta.customer_trx_id, rcta.trx_number, rcta.trx_date FROM ra_c ...

  2. How to Enable Trace or Debug for APIs executed as SQL Script Outside of the Applications ?

    In this Document   Goal   Solution   1: How do you enable trace for an API when executed from a SQL ...

  3. SQL SERVER – Import CSV File Into SQL Server Using Bulk Insert – Load Comma Delimited File Into SQL Server

    CSV stands for Comma Separated Values, sometimes also called Comma Delimited Values. Create TestTabl ...

  4. 可重复执行的SQL Script

    问题 在工作中偶尔会遇到这样的问题:SQL script重复执行时会报错. 理想的状态下,SQL script跑一遍就够了,是不会重复执行的,但是实际情况往往很复杂. 比如Dev同学在开发时在A环境把 ...

  5. MySQL5.7: sql script demo

    -- MyISAM Foreign Keys显示不了外键,MyISAM此为5.0 以下版本使用 InnoDB 为5.0以上版本使用 drop table IF EXISTS city; CREATE ...

  6. SQLite: sql script demo

    如果有成熟的架构,如何根据数据库关系的表.视图等,进行代码生成架构?减少写代码的时间? -- 考虑主键外键 -- create database geovindu; use geovindu; --2 ...

  7. csharp:SMO run sql script

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. How to import .sql script

    How to import .sql script 1.Export .sql from pl/sql developer you can reference to other document in ...

  9. doris: shell invoke .sql script for doris and passing values for parameters in sql script.

    1. background in most cases, we want to execute sql script  in doris  routinely. using azkaban, to l ...

随机推荐

  1. Asymptotic I Catalan Number

    卡特兰数出现在许多计数问题中. 常见的例子有:$n$ 个节点的有序二叉树,$2n$ 个括号构成的合法括号序列. 在上面所举的两个例子中,很容易看出卡特兰数满足递推: $$ C_{n+1} = \sum ...

  2. [CF1045C]Hyperspace Highways

    题目大意:给一张$n$个点$m$条边的图,保证若有一个环,一定是完全子图,多次询问两个点之间的最短路径长度 题解:把完全子图缩成一个点,圆方树,方点权值设成$1$,圆点设成$0$即可. 卡点:数组开小 ...

  3. Codeforces Round #516 (Div. 2)D. Labyrinth

    D. Labyrinth 题目链接:https://codeforces.com/contest/1064/problem/D 题意: 给出一个n*m的矩阵以及人物的起点,并且给出x,y,分别代表这个 ...

  4. code forces 994B

    B. Knights of a Polygonal Table time limit per test 1 second memory limit per test 256 megabytes inp ...

  5. JS省份联级下拉框

    <script type="text/javascript"> var china=new Object();china['北京市']=new Array('北京市区' ...

  6. View的三次measure,两次layout和一次draw

    我在<Android视图结构>这篇文章中已经描述了Activity,Window和View在视图架构方面的关系.前天,我突然想到为什么在setContentView中能够调用findVie ...

  7. 封装一下webform的公用方法:对于软件我把这些全封装在pagebase里面,这样所有的页面只调用一句 Init()即可,其他的全在页面上配置

      /// <summary>         /// 绑定新闻列表,带分页与查询         /// </summary>         /// <param n ...

  8. mysql [MariaDB] 开启外联

    1.查看mysql服务端口是否为外部端口,如果监听的是本地端口修改mariadb配置文件 root@kali:~# whereis mysql mysql: /usr/bin/mysql /etc/m ...

  9. Vue全局异常捕获

    之前没注意过这么个小技巧 , 可能在Vue文档里也有  暂时先记下了 方便摘要 Vue全局配置 errorHandler可以进行全局错误收集,我们可以根据这个特性对前端异常做这样的处理:业务错误直接写 ...

  10. 利用Excel导出sql语句

    在工作中遇到了需要用数据库的insert语句,本来是极其简单的事情,但是碰到了有n个(n很大)字段的表,写insert语句就是极其痛苦的事情了,即使只是复制粘贴也是很费力不讨好的一件事.正好手头有ex ...