锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
聽灝嗘斁鍦╠:\test鐩綍涓嬬殑涓や釜鏂囦歡'20061222鍚嶈瘝琛?txt','鍙傜収.txt',鏄犲皠鍒頒袱涓暟鎹簱琛ㄤ腑,鐒跺悗灝卞彲浠ュ疄鐜扮敤SQL璇彞璁塊棶鏅氱殑CSV鏂囦歡.
create directory dir_test as 'd:\test';
create table tbl_zidian
(
name varchar2(500),english varchar2(1000)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY dir_test
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
badfile 'x1.bad'
discardfile 's1.dis'
logfile 'x1.log'
fields terminated by ','
missing field values are null
)
LOCATION('20061222鍚嶈瘝琛?txt')
);
create table tbl_zidian_3
(
name varchar2(100)
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY dir_test
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
badfile 'x1.bad'
discardfile 's1.dis'
logfile 'x1.log'
fields terminated by ','
missing field values are null
)
LOCATION('鍙傜収.txt')聽聽--鐩綍閲?br />);
聽
create table tbl_tt2 as
select distinct ch_name,en_name,ch0_name from (
select b.name ch_name,a.english en_name,a.name ch0_name
from tbl_zidian a,tbl_zidian_3 b
where (a.name like '%'||b.name||'%') or (b.name like '%'||a.name||'%'));
select name,'','' from tbl_zidian_2
where name not in(select ch_name from tbl_tt) order by name