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. [codeforces438E]The Child and Binary Tree

    [codeforces438E]The Child and Binary Tree 试题描述 Our child likes computer science very much, especiall ...

  2. BZOJ 1014 [JSOI2008]火星人prefix | Splay维护哈希值

    题目: 题解: #include<cstdio> #include<algorithm> #include<cstring> typedef long long l ...

  3. 《c程序设计语言》读书笔记-4.1-判断字符串在另一个字符串中的位置

    #include <io.h> #include <stdio.h> #include <string.h> #include <stdlib.h> # ...

  4. java 复习整理(五 类加载机制与对象初始化)

    类加载机制与对象初始化   一 . 类加载机制 类加载机制是指.class文件加载到jvm并形成Class对象的机制.之后应用可对Class对象进行实例化并调用.类加载机制可在运行时动态加载外部的类, ...

  5. SyntaxError: Unexpected token ' in JSON at position 1

    刚才遇到一个问题: 在公司两个不同的环境竟然会出现错误 对比一下两个环境的数据,发现一个传来的是双引号的JSON字符串,一个是单引号.而当我用JSON.parse()时,就会报错!! 原因是JSON. ...

  6. "todoList妙味"学习总结

    1.v-bind  主要用于属性绑定 :class="{completed: item.isChecked}",它会将{}里面的内容解析为js表达式   2.vue提供了一组方法, ...

  7. git隐藏文件复制

    从网上down的开源项目,如何添加到自己的github上呢?   问题:直接复制老项目到自己的目录,隐藏的.git文件不会被复制过去,就算是执行cp命令,也不会复制!导致项目运行会出错!!   解决: ...

  8. 【CF1020E】Sergey's problem(构造)

    题意: 思路:这是一道论文题 https://link.springer.com/content/pdf/10.1007/BFb0066192.pdf From http://www.cnblogs. ...

  9. WebApi初探之基本操作(CRUD)

    public class ProductsController : ApiController { static List<Product> products = new List< ...

  10. Linux Mint---ATI显卡驱动安装篇

    显卡驱动可谓是至关重要,当时折腾debian驱动的时候可是弄了好几天才搞定的,现在却非常容易就是装上, 详见这篇博客:http://www.yyearth.com/article/14-03/amd1 ...