时间:2021-07-01 10:21:17 帮助过:17人阅读
set serveroutput on DECLARE CURSOR cemp is select empno ,job from emp ; pempno emp.empno%TYPE ; pjob emp.job%TYPE ; BEGIN OPEN cemp; LOOP FETCH cemp INTO pempno,pjob; EXIT WHEN cemp%notfound; if pjob=‘PRESIDENT‘ then update emp set sal=sal+1000 where empno=pempno; elsif pjob=‘MANAGER‘ then update emp set sal=sal+8000 where empno=pempno; else update emp set sal=sal+5000 where empno=pempno; end if; END LOOP; CLOSE cemp; commit; END; select * from emp
oracle 游标
标签:otf class man declare out lin weight oracle style