- 1
- 0
- 约6.32千字
- 约 7页
- 2018-05-22 发布于河南
- 举报
ORACLE学习资料第五章
第五章 游标和触发器
游标:
隐式游标:%FOUND, %NOTFOUND ,%ROWCOUNT
1.%FOUND 用法,只有在DML 语句影响一行或者多行时,%FOUND 属性才返回 TRUE。下列示例演示了 %FOUND 的用法:
begin
update employees2 set first_name = first_name || t where employee_id = 2;
if SQL%found then
dbms_output.put_line(数据已经更新);
-- dbms_output.put_line(rowCount = ||mrowcount);
else
dbms_output.put_line(数据没有找到);
end if;
end;
/
以下代码演示了创建了一个游标,返回employees2 表中 salary 大于300000 的记录,注意type 的使用:
declare
csalary employees2.salary%type;
cursor emp2_cursor is select salary from employees2 where salary 300000;
begin
open emp2_cursor ;
loop
f
原创力文档

文档评论(0)