oracle_load_csv
1、建表,
=========================================================
create table T_JD_RECOMM(
TIP_NO varchar2(6),
USR_NO VARCHAR2(10),
SKU_NO VARCHAR2(15),
TRDTYPE_NO VARCHAR2(6),
TRDTYPE_NAME VARCHAR2(20)
);
==========================================================
2、写ctl:
===========================================================
load data
infile 'G:\PROGRAM\0.自主开发\jd\jd_test.csv'
into table T_JD_RECOMM
fields terminated by ','
(TIP_NO,USR_NO,SKU_NO,TRDTYPE_NO,TRDTYPE_NAME)
============================================================
3、sqlldr userid=system/jianxiao@orcl control=G:\PROGRAM\0.自主开发\jd\ld.ctl log=G:\PROGRAM\0.自主开发\jd\ld.log
其它方法:
1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中
2. 建立数据库间的 dblink,然后用 create table B as select * from A@dblink where ...,或 insert into B select * from A@dblink where ...
3. exp A 表,再 imp 到 B 表,exp 时可加查询条件
4. 程序实现 select from A ..,然后 insert into B ...,也要分批提交
5. 再就是本篇要说到的 Sql Loader(sqlldr) 来导入数据,效果比起逐条 insert 来很明显