第一部分 第一步 :这是我的导出数据的脚本call.sql conn scott/tiger set echo off set term off set line 1000 pages 0 set feedback off set heading off set trimspool on spool /temp/test/ldr_test.csv select a.empno||',"'||a.ename||'",'||to_char(a.hiredate,'yyyy-mm-dd hh24:mi:ss')||','||a.sal from test a; spool off set trimspool off set heading on set feedback on set term on set echo on exit
第二步 :导入数据的脚本add_test.ctl LOAD DATA INFILE ldr_test.csv TRUNCATE INTO TABLE test FIELDS TERMINATED BY"," OPTIONALLY ENCLOSED BY'"' (EMPNO,ENAME,HIREDATE date 'yyyy-mm-dd hh24:mi:ss',SAL)