declare

    Type ref_cur_emp IS REF CURSOR RETURN scott.emp%RowType;
cur_emp ref_cur_emp;
rec_emp cur_emp%RowType; v_sql varchar2(100) := 'select * from scott.emp t'; begin -- xxx Open cur_emp For v_sql;
Open cur_emp For
select * from scott.emp t;
Loop
fetch cur_emp
InTo rec_emp;
Exit When cur_emp%NotFound;
dbms_output.put_line(cur_emp%rowcount || ' -> ' || rec_emp.empno ||
' ' || rec_emp.sal);
End Loop;
Close cur_emp; end;

Oracle PLSQL Demo - 15.强类型REF游标[预先指定查询类型与返回类型]的更多相关文章

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

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

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

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

  3. Oracle PLSQL Demo - 29.01.Function结构模板 [无入参] [有返回]

    CREATE OR REPLACE FUNCTION function_name RETURN DATE AS v_date DATE; BEGIN ; dbms_output.put_line(v_ ...

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

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

  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 - 13.游标的各种属性[Found NotFound ISOpen RowCount CURSOR]

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

  7. 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 ...

  8. 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; ...

  9. 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. ...

随机推荐

  1. java面试第九天

    图形界面: 布局管理器: CardLayout:卡片布局,面板重叠放置,只能看到一个,最先添加的会被显示出来,可以进行翻动 两种构造方法: CardLayout() 创建一个间隙大小为 0 的新卡片布 ...

  2. Java Lombok 减少代码冗余 get set

    1.下载 2.安装 java -jar Users\uatww990393\Desktop\lombok-1.16.16.jar a. 直接添加jar包到lib中  在java中项目中使用lombok ...

  3. jqGrid删除多行数据问题

    var consoleDlg = $("#delcostListDlg"); var selectedRowIds = $("#costList").jqGri ...

  4. 【面试笔试】Java常见面试笔试总结

    Java 基础 1.有哪些数据类型 Java定义了8种简单类型:byte.short.int.long.char.float.double和boolean. 2.面向对象的语言特征 封装.继承.多态 ...

  5. Asp.net Mvc (Filter及其执行顺序)

    应用于Action的Filter 在Asp.netMvc中当你有以下及类似以下需求时你可以使用Filter功能判断登录与否或用户权限,决策输出缓存,防盗链,防蜘蛛,本地化设置,实现动态Actionfi ...

  6. HTTP所承载的货物(图像、文本、软件等)要满足的条件

    HTTP所承载的货物(图像.文本.软件等)要满足的条件: •可以被正确识别 通过Content-Type 首部说明媒体格式,Content-Language 说明语言,以便浏览器和其他客户端能正确处理 ...

  7. 网址URL中特殊字符转义编码

    网址URL中特殊字符转义编码字符 - URL编码值空格 - %20" - %22# - %23% - %25& - %26( - %28) - %29+ - %2B, - %2C/ ...

  8. tomcat在线部署且查看堆栈状态

    配合ab压测tomcat站点的并发量,适当调整JVM参数,堆栈,连接数 00.修改conf/tomcat-user.xml 1. 在$Tomcat_Home/conf/tomcat-users.xml ...

  9. mysql之InnoDB内存管理

    InnoDB缓冲池是通过LRU算法来管理page的.频繁使用的page放在LRU列表的前端,最少使用的page在LRU列表的尾端,缓冲池满了的时候,优先淘汰尾端的page. InnoDB中的LRU结构 ...

  10. [ubuntu]为ubuntu设立“任务管理器”的组合键

    在windows下面,我们可以方便的使用ctrl+alt+delete调出任务管理器,那么在ubuntu下面如何实现呢?这里我们介绍两种方法:1.在终端下运行: 代码:gconf-editor 找到: ...