create or replace procedure p
is
cursor c is
select * from emp2 for update;
begin
for v_emp in c loop
if (v_emp.deptno = 10) then
update emp2 set sal = sal + 1 where current of c;
elsif (v_emp.deptno = 20) then
update emp2 set sal = sal + 2 where current of c;
else
update emp2 set sal = sal + 5 where current of c;
end if;
end loop;
commit;
end;
-------------------------------------------------------------------------------------------------
create or replace procedure p
(v_a in number, v_b number, v_ret out number,v_temp in out number)
is
begin
if(v_a < v_b) then
v_ret := v_a;
else
v_ret := v_b;
end if;
v_temp := v_temp + 1;
end;
---------------------------------------------------------------------------------
为什么上面的程序 update emp2 set sal = sal + 1 where current of c; 这里的 赋值用=
下面的用的 是 := 呀;
@AskMaclean