问题描述
我正在使用SQL LOADER在一个表中加载多个csv文件.我发现的过程非常简单,就像
I am using SQL LOADER to load multiple csv file in one table.The process I found is very easy like
LOAD
DATA
INFILE '/path/file1.csv'
INFILE '/path/file2.csv'
INFILE '/path/file3.csv'
INFILE '/path/file4.csv'
APPEND INTO TABLE TBL_DATA_FILE
EVALUATE CHECK_CONSTRAINTS
REENABLE DISABLED_CONSTRAINTS
EXCEPTIONS EXCEPTION_TABLE
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
COL0,
COL1,
COL2,
COL3,
COL4
)
但是我不想多次使用INFILE,因为如果我有1000个以上的文件,那么我必须在控制文件脚本中提及1000次INFILE.
But I don't want to use INFILE multiple time cause if I have more than 1000 files then I have to mention 1000 times INFILE in control file script.
所以我的问题是:是否有其他方法(如任何循环/任何* .csv)加载多个文件而不使用多个infile?
So my question is: is there any other way (like any loop / any *.csv) to load multiple files without using multiple infile?
谢谢,碧通
推荐答案
解决方案1:能否将1000个文件连接到大文件中,然后由SQL * Loader加载.在Unix上,我会使用类似的
Solution 1: Can you concatenate the 1000 files into on big file, which is then loaded by SQL*Loader. On unix, I'd use something like
cd path
cat file*.csv > all_files.csv
这篇关于通过SQLLDR将多个csv加载到一个表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!