永发信息网

在oracle要写这样一个存储过程,不知为什么老是报错,求解答?

答案:2  悬赏:10  手机版
解决时间 2021-11-24 14:17
  • 提问者网友:泪痣哥哥
  • 2021-11-24 07:33
在oracle要写这样一个存储过程,不知为什么老是报错,求解答?
最佳答案
  • 五星知识达人网友:慢性怪人
  • 2021-11-24 07:49
Oracle中没有Update from 的语法

create or replace procedure priceplanpro
(nstart in number,noid in number,plan in number)
as
begin
if nstart > 0 then
update ductprice p set p.nprice= plan
where noid = noid and start=nstart and nsta = 2021
and exists(select * from priceplan r where r.ncorp=p.ncorp) ;
end if;
exception
when no_data_found then
dbms_output.put_line('数据不存在!');
end priceplanpro;
全部回答
  • 1楼网友:洎扰庸人
  • 2021-11-24 08:19
那段update语句改成如下语句
merge priceplan r
using ductprice p
on (r.ncorp=p.ncorp and r.noid = p.noid and r.start=p.nstart and r.nsta = 2021)
when matched then
update
set p.nprice= plan
;追问

填上into 还是报下面的错,求解答啊大神?

merge into priceplan r using ductprice p on (r.ncorp=p.ncorp and r.noid =0 and r.start=12
and r.nsta = 2021) when matched then update set p.nprice= 0

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯