declare

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

Oracle PLSQL Demo - 16.弱类型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 - 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 ...

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

  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 - 17.游标查询个别字段(非整表)

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

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

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

  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 - 19.管道function[查询整表组成list管道返回]

    create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETU ...

随机推荐

  1. 线性表 顺序存储 链式存储 ---java实现

    首先抽象出一个线性表抽象类(包括主要的增删操作) public abstract class MyAbstractList<E> { public abstract void add(E ...

  2. [2014.5.13][Ubuntu] Ubuntu 14.04STL 出现NTFS分区无法訪问的问题

    5.12 为了给学生改论文,在UPC上登录了Windows 8.1,晚上正常关机.今日切换登陆Ubuntu 14.04分区,发现原来能够正常訪问的windows下的NTFS分区都被锁死.提演示样例如以 ...

  3. PHP 在Win下的安装

    1:安装集成环境,Wamp或者Appserv.可以快速搭建测试环境. 2:分别下载安装 下载 PHP 从此处下载免费的 PHP:http://www.php.net/downloads.php 下载 ...

  4. 解决Eclipse的Servers视图中无法添加Tomcat6/Tomcat7

    如何解决 . 关闭Eclipse . 打开WorkSpace所在的位置. {workspace-directory}/.metadata/.plugins/org.eclipse.core.runti ...

  5. ORACLE检查死锁

    一.数据库死锁的现象程序在执行的过程中,点击确定或保存按钮,程序没有响应,也没有出现报错.二.死锁的原理当对于数据库某个表的某一列做更新或删除等操作,执行完毕后该条语句不提交,另一条对于这一列数据做更 ...

  6. java 管道流代码示例

    import java.io.IOException;import java.io.PipedInputStream;import java.io.PipedOutputStream; public ...

  7. 如何监控tomcat性能

    如何监控tomcat性能:[1]工具一 | 浏览:155 | 更新:2014-12-13 10:06 1 2 3 4 5 6 分步阅读 tomcat经常被用作中间件,也有直接作WEB的,自带的工具不是 ...

  8. linux shutdown命令

    shutdown [-t 秒] [-arkhncfF] 时间 [警告信息] 常用选项与参数: -t sec : -t 后面加秒数,亦即『过几秒后关机』的意思 -k : 不要真的关机,只是发送警告信息出 ...

  9. redis阻塞bgsave与bsrewriteaof

    问题描述: redis在进程偶尔会出现2个进程redis-server \ redis-bgsave Redis 首先 fork 一个子进程, 并在该子进程里进行归并和写持久化存储设备(如硬盘)的. ...

  10. Object-c中block需要注意的几点问题

    1. Block定义 1) 说明: a. Block是OC中的一种数据类型,在iOS开发中被广泛使用 b. ^是Block的特有标记 c. Block的实现代码包含在{}之间 d. 大多情况下,以内联 ...