declare
r_emp scott.emp%rowtype;
cursor cur_emp is
select t.* from scott.emp t; begin open cur_emp; if cur_emp%isopen then
dbms_output.put_line('is open...');
end if; loop
fetch cur_emp
into r_emp; if cur_emp%found then
dbms_output.put_line('found...');
end if; if cur_emp%notfound then
dbms_output.put_line('not found...');
end if; exit when cur_emp%notfound; dbms_output.put_line(cur_emp%rowcount || ' -> ' || r_emp.empno ||
' ' || r_emp.sal); end loop; close cur_emp; end;

Oracle PLSQL Demo - 13.游标的各种属性[Found NotFound ISOpen RowCount CURSOR]的更多相关文章

  1. Oracle PLSQL Demo - 17.游标查询个别字段(非整表)

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_empno scott.emp.empno% ...

  2. Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...

  3. Oracle PLSQL Demo - 16.弱类型REF游标[没有指定查询类型,已指定返回类型]

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; rec_emp scott.emp%RowTyp ...

  4. Oracle PLSQL Demo - 15.强类型REF游标[预先指定查询类型与返回类型]

    declare Type ref_cur_emp IS REF CURSOR RETURN scott.emp%RowType; cur_emp ref_cur_emp; rec_emp cur_em ...

  5. Oracle PLSQL Demo - 14.定义定参数的显示游标

    declare v_empno scott.emp.empno%type; v_sal scott.emp.sal%type; ) is select t.empno, t.sal from scot ...

  6. Oracle PLSQL Demo - 10.For Loop遍历游标[FOR LOOP CURSOR]

    declare cursor cur_emp is select t.* from scott.emp t; begin for r_emp in cur_emp loop dbms_output.p ...

  7. Oracle PLSQL Demo - 09.Open、Fetch遍历游标[Open, Fetch, Close Record CURSOR]

    declare r_emp scott.emp%rowtype; cursor cur_emp is select t.* from scott.emp t; begin open cur_emp; ...

  8. Oracle PLSQL Demo - 08.定义显式游标[Define CURSOR, Open, Fetch, Close CURSOR]

    declare v_empno scott.emp.empno%type; v_sal scott.emp.sal%type; cursor cur_emp is select t.empno, t. ...

  9. Oracle PLSQL Demo - 31.执行动态SQL拿一个返回值

    DECLARE v_sql ) := ''; v_count NUMBER; BEGIN v_sql := v_sql || 'select count(1) from scott.emp t'; E ...

随机推荐

  1. Tomcat 设置URI默认字符集为UTF-8

    新配置一个Spring的MVC项目.发现对Get请求的中文參数出现了乱码: 查看了SpingMVC中关于编码的配置(在web.xml中).例如以下 <filter> <filter- ...

  2. Socket实现服务器与客户端的交互

       连接过程:   根据连接启动的方式以及本地套接字要连接的目标,套接字之间的连接过程可以分为三个步骤:服务器监听,客户端请求,连接确认. (1)服务器监听:是服务器端套接字并不定位具体的客户端套接 ...

  3. 创建安全的基于HTTP的api应用接口

    #http://my.oschina.net/xiangtao/blog/196211 #要创建安全的基于HTTP的api接口,最重要的是要在服务端的进行请求的认证. #如何进行有效的服务端验证呢? ...

  4. repr

    >>> import datetime >>> today=datetime.datetime.now() >>> today datetime. ...

  5. Android 线性布局(LinearLayout)相关官方文档 - 指南部分

    Android 线性布局(LinearLayout)相关官方文档 - 指南部分 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用 ...

  6. YACC、LEX、JAVACC-------常用的编译工具

    CC(Compiler Compiler) CC的意思就是"编译器的编译器". 你可以定义一种上下文无关文法(CFG),然后针对这个特定的CFG你可以写出一个C程序来解释这种CFG ...

  7. 【LeetCode】22. Generate Parentheses (2 solutions)

    Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of ...

  8. vi/vim 计算搜寻关键字数量

    http://hi.baidu.com/xletian/blog/item/f19962061a9a506c020881dc.html 在看过 vim 的全域指令和 search 指令之後,你会不会也 ...

  9. Android开发学习之浅谈显示Intent和隐式Intent

    Intent寻找目标组件的两种方式: 显式Intent:通过指定Intent组件名称来实现的,它一般用在知道目标组件名称的前提下,一般是在相同的应用程序内部实现的. 隐式Intent:通过Intent ...

  10. 基于SpringCloud的微服务实践

    微服务不同于单一架构应用, 是典型的分布式场景, 各服务之间通过IPC进行通信. 实现微服务的过程中, 我们需要解决以下问题: 服务注册和服务发现. 根据应用选择合适的通信协议和数据协议. 例如可以选 ...