declare
cursor c is select * from emp for update;
begin
for v_temp in c loop
if(v_temp.sal<2000) then
update emp set sal=sal*2 where current of c;
elsif(v_temp.sal=5000) then
delete emp where current of c;
end if;
end loop;
commit;
end;
为什么sal=sal*2而不是sal:=sal*2?不是说赋值用":="比较才用"="吗?
cursor c is select * from emp for update;
begin
for v_temp in c loop
if(v_temp.sal<2000) then
update emp set sal=sal*2 where current of c;
elsif(v_temp.sal=5000) then
delete emp where current of c;
end if;
end loop;
commit;
end;
为什么sal=sal*2而不是sal:=sal*2?不是说赋值用":="比较才用"="吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货