关于oracle数据库的问题,帮忙看看哪错了。。。
merge into hy_wldw a
using (select * from jh_jk_order where TRANSID in('646','645')) b
on (a.dwno =b.SELLERID)
when matched then
update
set a.dwmc = b.sname,
a.dwlx = '2',
a.dz = b.saddress,
a.cs = decode(b.FROMDISTRICT, null, b.FROMCITY, b.FROMDISTRICT),
a.sf = b.FROMPROV,
a.lxr = b.sname,
a.dh = b.SMOBILEPHONE,
a.sjno = b.SELLERID,
a.yzbm = '1',
a.xtfl = '1'
when not matched then
insert
( dwmc, dwlx, dz, cs, sf, lxr, dh, sjno, yzbm, xtfl)
values
(
b.SNAME,
'2',
b.SADDRESS,
decode(b.FROMDISTRICT, null, b.FROMCITY, b.FROMDISTRICT),
b.FROMPROV,
b.SNAME,
b.SMOBILEPHONE,
b.SELLERID,
'1',
'1')
[解决办法]
肯定有某个空值约束,这个要好好看看自己的,也有可能是jh_jk_order表出來的值是NULL导致
[解决办法]
肯定应该有不允许为空的字段吧,否则如果都为空还有什么意义。