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. [LOJ#6259]「CodePlus 2017 12 月赛」白金元首与独舞

    [LOJ#6259]「CodePlus 2017 12 月赛」白金元首与独舞 试题描述 到河北省 见斯大林 / 在月光下 你的背影 / 让我们一起跳舞吧 うそだよ~ 河北省怎么可能有 Stalin. ...

  2. [洛谷P3810]【模板】三维偏序(陌上花开)

    题目大意:有$n$个元素,第$i$个元素有三个属性$a_i,b_i,c_i$,设$f(i)=\sum\limits_{i\not = j}[a_j\leqslant a_i,b_j\leqslant ...

  3. 排序(sortb)

    题目描述 懒得写题目背景了,就不写了. 有一个 $0, 1 \dots n − 1$ 的排列 $p_1, p_2 \dots p_n$,如果 $p_i ⊕ p_j ≤ a$(其中 $⊕$ 为按位异或) ...

  4. html li css选中状态切换

    思路:点击当前li元素后是用removeClass()删除所有兄弟元素(使用siblings()获取)的class样式,然后使用addClass()为当前li添加class. 具体演示如下: 1.HT ...

  5. typedef函数用法

    转载自:http://www.cnblogs.com/ggjucheng/archive/2011/12/27/2303238.html 引言 typedef 声明,简称 typedef,为现有类型创 ...

  6. spring in action 学习十一:property placeholder Xml方式实现避免注入外部属性硬代码化

    这里用到了placeholder特有的一个语言或者将表达形式:${},spring in action 描述如下: In spring wiring ,placeholder values are p ...

  7. C语言浮点数存储方式

    对于浮点类型的数据采用单精度类型(float)和双精度类型(double)来存储,float数据占用 32bit,double数据占用 64bit.其实不论是float类型还是double类型,在计算 ...

  8. [ CodeVS冲杯之路 ] P3143

     不充钱,你怎么AC? 题目:http://codevs.cn/problem/3143/ 大水题一道,只要会遍历,这里讲一下思路 先序遍历:先输出,然后左儿子,最后右儿子 中序遍历:先左儿子,再输出 ...

  9. Vue.js 2使用中的难点举例--子组件,slot, 动态组件,事件监听

    一例打尽..:) <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...

  10. “玲珑杯”ACM比赛 Round #1

    Start Time:2016-08-20 13:00:00 End Time:2016-08-20 18:00:00 Refresh Time:2017-11-12 19:51:52 Public ...