执行您正在寻找的操作的 sqlldr 的替代方法是 SQLcl 中的 LOAD 命令。它只是将 csv 中的标题行与表匹配并加载它。然而,这并不像 sqlldr 那样高性能,也没有那么多控制。
LOAD [schema.]table_name[@db_link] file_name
这是它的完整帮助。
sql klrice/klrice
...
KLRICE@xe>help load
LOAD
-----
Loads a comma separated value (csv) file into a table.
The first row of the file must be a header row. The columns in the header row must match the columns defined on the table.
The columns must be delimited by a comma and may optionally be enclosed in double quotes.
Lines can be terminated with standard line terminators for windows, unix or mac.
File must be encoded UTF8.
The load is processed with 50 rows per batch.
If AUTOCOMMIT is set in SQLCL, a commit is done every 10 batches.
The load is terminated if more than 50 errors are found.
LOAD [schema.]table_name[@db_link] file_name
KLRICE@xe>
来自我在https://github.com/krisrice/maxmind-oracledb的 git repo 的示例
SQL> drop table geo_lite_asn;
Table GEO_LITE_ASN dropped.
SQL> create table geo_lite_asn (
2 "network" varchar2(32),
3 "autonomous_system_number" number,
4 "autonomous_system_organization" varchar2(200))
5 /
Table GEO_LITE_ASN created.
SQL> load geo_lite_asn GeoLite2-ASN-CSV_20180130/GeoLite2-ASN-Blocks-IPv4.csv
--Number of rows processed: 397,040
--Number of rows in error: 0
0 - SUCCESS: Load processed without errors
SQL>