首页 新闻 会员 周边 捐助

请教一个oracle的关于merge into插入修改的包含长clob字段的问题

0
[待解决问题]

我的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又会报类型错误

xph的主页 xph | 菜鸟二级 | 园豆:202
提问于:2018-01-22 16:16
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册