我的sql是这样的merge into ODM_ORCS_INTACN_OPRAR_LOGS t1
using
(
select
BTDATE,ODS_IFFLG,LOG_ID,CHANNEL_NO,REQUEST_IP,ID_NO,to_char(REQUEST_DATA) REQUEST_DATA,to_char(THIRD_RES_DATA) THIRD_RES_DATA,RESPONSE_CODE,to_char(RESPONSE_DATA) RESPONSE_DATA,TRADE_TIME,IS_LOCAL,REMARK
from ODS_ORCS_INTACN_OPRAR_LOGS
minus
select
BTDATE,ODS_IFFLG,LOG_ID,CHANNEL_NO,REQUEST_IP,ID_NO,to_char(REQUEST_DATA) REQUEST_DATA,to_char(THIRD_RES_DATA) THIRD_RES_DATA,RESPONSE_CODE,to_char(RESPONSE_DATA) RESPONSE_DATA,TRADE_TIME,IS_LOCAL,REMARK
from ODM_ORCS_INTACN_OPRAR_LOGS
) t2
on (t1.LOG_ID=t2.LOG_ID)
when matched then
update set
t1.BTDATE=t2.BTDATE,t1.ODS_IFFLG=t2.ODS_IFFLG,t1.CHANNEL_NO=t2.CHANNEL_NO,t1.REQUEST_IP=t2.REQUEST_IP,t1.ID_NO=t2.ID_NO,t1.REQUEST_DATA=t2.REQUEST_DATA,t1.THIRD_RES_DATA=t2.THIRD_RES_DATA,t1.RESPONSE_CODE=t2.RESPONSE_CODE,t1.RESPONSE_DATA=t2.RESPONSE_DATA,t1.TRADE_TIME=t2.TRADE_TIME,t1.IS_LOCAL=t2.IS_LOCAL,t1.REMARK=t2.REMARK
when not matched then
insert(
t1.BTDATE,t1.ODS_IFFLG,t1.LOG_ID,t1.CHANNEL_NO,t1.REQUEST_IP,t1.ID_NO,t1.REQUEST_DATA,t1.THIRD_RES_DATA,t1.RESPONSE_CODE,t1.RESPONSE_DATA,t1.TRADE_TIME,t1.IS_LOCAL,t1.REMARK
)
values(
t2.BTDATE,t2.ODS_IFFLG,t2.LOG_ID,t2.CHANNEL_NO,t2.REQUEST_IP,t2.ID_NO,t2.to_char(REQUEST_DATA) REQUEST_DATA,t2.to_char(THIRD_RES_DATA) THIRD_RES_DATA,t2.RESPONSE_CODE,t2.to_char(RESPONSE_DATA) RESPONSE_DATA,t2.TRADE_TIME,t2.IS_LOCAL,t2.REMARK
)
这样clob字段的长度大于4000就会报错,但是去掉to_char又会报类型错误