SQL Server存储过程语句转换为 Oracle 储存过程语句
如下:UPDATEZR_ORD_ORDERD2SETCTRADENAME=ORD1.CPARTNAMEFROMZR_ORD_ORDERD2ORD2LEFTJOINZR_O...
如下:UPDATE ZR_ORD_ORDERD2
SET CTRADENAME=ORD1.CPARTNAME
FROM ZR_ORD_ORDERD2 ORD2
LEFT JOIN ZR_ORD_ORDERD1 ORD1 ON ORD2.CSPEC=ORD1.CSPEC AND ISNULL(ORD2.CTRADENAME,'')=''
WHERE ORD2.ZR_ORD_MASTER_FK=v_ZR_ORD_MASTEROID;
怎么转换成Oracle语句啊,求大神帮忙!
原语句是这样的UPDATE dbo.ZR_ORD_ORDERD2
SET CTRADENAME=ORD1.CPARTNAME
FROM dbo.ZR_ORD_ORDERD2 ORD2
LEFT JOIN dbo.ZR_ORD_ORDERD1 ORD1 ON ORD2.CSPEC=ORD1.CSPEC AND ISNULL(ORD2.CTRADENAME,'')=''
WHERE ORD2.ZR_ORD_MASTER_FK=@ZR_ORD_MASTEROID 展开
SET CTRADENAME=ORD1.CPARTNAME
FROM ZR_ORD_ORDERD2 ORD2
LEFT JOIN ZR_ORD_ORDERD1 ORD1 ON ORD2.CSPEC=ORD1.CSPEC AND ISNULL(ORD2.CTRADENAME,'')=''
WHERE ORD2.ZR_ORD_MASTER_FK=v_ZR_ORD_MASTEROID;
怎么转换成Oracle语句啊,求大神帮忙!
原语句是这样的UPDATE dbo.ZR_ORD_ORDERD2
SET CTRADENAME=ORD1.CPARTNAME
FROM dbo.ZR_ORD_ORDERD2 ORD2
LEFT JOIN dbo.ZR_ORD_ORDERD1 ORD1 ON ORD2.CSPEC=ORD1.CSPEC AND ISNULL(ORD2.CTRADENAME,'')=''
WHERE ORD2.ZR_ORD_MASTER_FK=@ZR_ORD_MASTEROID 展开
1个回答
2015-07-23
展开全部
update zr_ord_orderd2 ord2 set ctradename=
(select cpartname from zr_ord_orderd2 where cspec=ord2.cspec)
where nvl(ord2.ctradename,' ')=' ' and ord2.zr_ord_master_fk=zr_ord_masteroid
and exists(select null from zr_ord_orderd2 where cspec=ord2.cspec);
你试下。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询