mctname字段(Varchar2(64)) 在tmp_mctinf <(Varchar2(64)),所以放不进去,Insert into tmp_mctinf (select newmctcode,substr(mctname,1,10) from mctinf where
newmctinf not in (select mctcode from tmp_mctinf));
newmctinf not in (select mctcode from tmp_mctinf));
desc mctinf ;传上结果
Name Null? Type
----------------------------------------- -------- ----------------------------
MCTCODE VARCHAR2(12)
MCTNAME VARCHAR2(64)SQL> desc mctinf;
Name Null? Type
----------------------------------------- -------- ----------------------------
NEWMCTCODE NOT NULL CHAR(15)
MCTTYPE CHAR(4)
MCTNAME CHAR(64)
CHECKLMTAMT NUMBER(13,2)
AREACODE CHAR(8)
RESERVED CHAR(32)
PINLMTAMT CHAR(20)
ADDRESS CHAR(60)
RESERVED2 CHAR(32)
Insert into tmp_mctinf (select substr(newmctcode,1,12),mctname from mctinf where
newmctinf not in (select mctcode from tmp_mctinf));
^_^
我没注意到mctinf表中的newmctcode是char型的,如果是varchar2的,我的语句就没问题了。