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. 《c程序设计语言》读书笔记-递归实现快速排序算法

    #include <stdio.h> void swap(int v[],int i,int j) { int temp; temp = v[i]; v[i] = v[j]; v[j] = ...

  2. es6+最佳入门实践(2)

    2.解构赋值 2.1.什么是解构赋值? 什么是解构赋值?这里的关键字还是赋值,这是说如何去赋值的问题,这里说的解构可以理解为解散重新构造,所以解构赋值可以理解为解散重新构造后进行赋值,通常是左边一种结 ...

  3. sql server创建外键,子母表,级联删除。

    级联删除. 最近建一个合同关系,在原有的资产平台上添加维保合同关系,维保合同问题, 需要在后面添加资产的维保合同,使用ef,该添加的冗余字段都已经添加上了,现在做这个,删除的时候只删了主表提示出问题, ...

  4. web页面效果开源框架收集整合

    1.EasyUI:http://www.jeasyui.com/index.php 2.Bootstrap:http://www.bootcss.com/ 3.jqueryui:http://jque ...

  5. 开车旅行(NOIP2012)

    原题传送门 这道坑爹题调了我2小时233~ 首先这道题可以用set,平衡树,双向链表等一堆非(sang)常(xin)简(bing)单(kuang)的算法搞出对于任何一个高度h[i]的前2名和后2名 然 ...

  6. 获取Json对象的长度以及判断json对象是否为空

    (如有错敬请指点,以下是我工作中遇到并且解决的问题) = = = = = = = = = = = = = = = =  获取Json对象的长度  = = = = = = = = = = = = = = ...

  7. Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file: /tmp/hsperfdata_hadoop/44512

    早上登录hbase shell,出现异常: [hadoop@node002 ~]$ hbase shell Java HotSpot(TM) 64-Bit Server VM warning: Ins ...

  8. python3正则表达式符号和用法

  9. python每日一类(1):pathlib

    每天学习一个python的类(大多数都是第三方的),聚沙成金. -------------------------------------------------------------------- ...

  10. 来杯咖啡-装饰者模式(Decorator)

    前言 上篇[观察者模式]发布已经近一个月了,个人感觉反应并不太理想,因为大家响应都不是很积极,不知是文章那里写得有问题,而且也没有人提出过有价值的改进建议,多少感觉有些失望L!因为工作繁忙,所以不可能 ...