关于merge时,出现的ORA-00904 invalid identifier

今天在写一个merge语句时,总是出现上述错误。

merge into JCSS_TicketInfo TT using v_ocainfo v_with
on ( tt.TICKETSEQ = v_with.ticketSeq)
when matched then update set
ticketSeq = v_with.ticketSeq ,

acceptTime = v_with.acceptTime ,
iceFullName = v_with.serviceFullName ,
userCity = v_with.userCity ,
userPhone = v_with.userPhone ,
userLevel = v_with.userLevel ,
serviceType = v_with.serviceType ,
serviceContent = v_with.serviceContent ,
ifComplainRepeat = v_with.ifComplainRepeat ,
userHopeResTime = v_with.userHopeResTime ,
userHlr = v_with.userHlr ,
place = v_with.place ,
terminalType = v_with.terminalType ,
spCode = v_with.spCode ,
serviceCode = v_with.serviceCode ,
groupId = v_with.groupId ,
groupName = v_with.groupName ,
groupType = v_with.groupType
when not matched then
insert( ticketSeq,
acceptTime,
serviceFullName,
userCity,
userPhone,
userLevel,
serviceType,
serviceContent,
ifComplainRepeat,
userHopeResTime,
userHlr,
place,
terminalType,
spCode,
serviceCode,
groupId,
groupName,
groupType
)
values(
v_with.ticketSeq,
v_with.acceptTime,
v_with.serviceFullName,
v_with.userCity,
v_with.userPhone,
v_with.userLevel,
v_with.serviceType,
v_with.serviceContent,
v_with.ifComplainRepeat,
v_with.userHopeResTime,
v_with.userHlr,
v_with.place,
v_with.terminalType,
v_with.spCode,
v_with.serviceCode,
v_with.groupId,
v_with.groupName,
v_with.groupType) ;

检查我的语句,也没有字段错误啊。

后来,查看oracle sql Reference

发现:

Restrictions on the merge_update_clause This clause is subject to the following restrictions:

  • You cannot update a column that is referenced in the ON condition clause.

  • You cannot specify DEFAULT when updating a view.

经修改,取消了针对匹配条件的update列。问题解决。

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/197458/viewspace-1008850/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/197458/viewspace-1008850/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值