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. [洛谷P2801]教主的魔法

    题目大意:有$n$个数,$q$个操作.两种操作: $M\;l\;r\;w:$把$[l,r]$所有数加上$w$ $A\;l\;r\;c:$查询$[l,r]$内大于等于$c$的元素的个数. 题解:分块,对 ...

  2. [ARC083F] Collecting Balls [建二分图+环套树定向+建拓扑图+树的拓扑序计数]

    题面 [传送门](https://arc083.contest.atcoder.jp/tasks/arc083_d) 思路 这是一道真正的好题 第一步:转化模型 行列支配类的问题,常见做法就是把行和列 ...

  3. POJ3585 Accumulation Degree 【树形dp】

    题目链接 POJ3585 题解 -二次扫描与换根法- 对于这样一个无根树的树形dp 我们先任选一根进行一次树形dp 然后再扫一遍通过计算得出每个点为根时的答案 #include<iostream ...

  4. 让chrome支持本地Ajax请求

    Chrome的安全机制不能支持ajax的本地访问, 例如: 在JavaScript里面访问 URL:file:///E:/test.html,Chrome 浏览器报错:XMLHttpRequest c ...

  5. nutch 2.1安装问题集锦

    参照官方文档http://nlp.solutions.asia/?p=180 中间碰到的问题,解决方法参考 http://blog.javachen.com/2014/05/20/nutch-intr ...

  6. Android四大组件:Service

    前言 Service作为Android四大组件之一,应用非常广泛 本文将介绍对Service进行全面介绍(基础认识.生命周期.使用和应用场景) 目录 目录 1. 基础知识 定义:服务,属于Androi ...

  7. SpringBoot设置事务管理

    关于事务就不介绍了,前面在研究spring的时候就已经研究过了,参考:https://www.cnblogs.com/qlqwjy/p/7296493.html 这里直接研究springboot中事务 ...

  8. jQuery遍历文档(重要)

    什么是遍历? jQuery 遍历,意为"移动",用于根据其相对于其他元素的关系来"查找"(或选取)HTML 元素.以某项选择开始,并沿着这个选择移动,直到抵达您 ...

  9. ping(NOIP模拟赛Round 4)第一次程序Rank 1!撒花庆祝!~\(≧▽≦)/~

    题目: 恩,就是裸的字符串处理啦. 连标程都打的是暴力(随机数据太水啦!吐槽.) 本来O(n^2q)TLE好吧.. 然后我发明了一种神奇的算法,随机数据跑的很快!,当然最坏复杂度跟标程一样啦. 不过期 ...

  10. Duplicate the UIButton and Move it

    http://stackoverflow.com/questions/19241208/duplicate-the-uibutton-and-move-it/26438692#26438692 1do ...