oracle中游标的使用,示例
2011-11-04 09:30
274 查看
1.如果雇员工资低于2000,则给雇员增加10%的工资。(scott用户中的emp表)
declare
cursor emp_cursor is select ename,sal from emp for update;
emp_record emp_cursor%rowtype;
begin
open emp_cursor;
loop
fetch emp_cursor into emp_record;
exit when emp_cursor%notfound;
if emp_record.sal<2000 then
update emp set sal=sal*1.1 where current of emp_cursor;
end if;
end loop;
end;
declare
cursor emp_cursor is select ename,sal from emp for update;
emp_record emp_cursor%rowtype;
begin
open emp_cursor;
loop
fetch emp_cursor into emp_record;
exit when emp_cursor%notfound;
if emp_record.sal<2000 then
update emp set sal=sal*1.1 where current of emp_cursor;
end if;
end loop;
end;
相关文章推荐
- Oracle 游标记录使用示例
- oracle游标使用示例
- Oracle 游标使用全解
- Oracle之函数中使用游标
- Oracle 游标使用
- oracle pl/sql 入门+ 数组使用+游标+动态SQL
- oracle游标使用
- oracle中decode函数的使用方法示例
- Oracle中使用游标转换数据表中指定字段内容格式(拼音转数字)
- Oracle 游标使用大全
- Oracle Show_space 过程 使用示例 与 注释
- oracle模糊查询语句使用示例
- oracle游标的使用
- oracle Pipelined Table Functions 的使用 (包含split函数的示例)
- Oracle 存储过程 使用示例 .
- oracle中游标,数组的使用
- Java使用Oracle遇到的最大游标超出问题及其解决方法
- Oracle expdp/impdp 使用示例
- Oracle中游标的使用