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 类型, Hibernate 映射类型及 SQL 类型之间的相应关系

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/ ...

  2. Java获取登录用户IP地址

    /** * 获取登录用户IP地址 * * @param request * @return */ public static String getIpAddr(HttpServletRequest r ...

  3. iOS调试证书/公布证书制作

    当已经注冊过applied 开发人员账号后,而且进行付款了,那么接下来就是证书制作了 1.登录membercenter https://developer.apple.com/membercenter ...

  4. 解决Unable to load component class org.sonar.scanner.report.ActiveRulesPublisher/Unable to load component interface org.sonar.api.batch.rule.ActiveRules: NullPointerException

    解决办法 Delete the directory data/es in your SonarQube installation. Restart SonarQube.

  5. Memcached安装与配置

     memcached是danga.com的一个项目.它是一款开源的高性能的分布式内存对象缓存系统.最早是给LiveJournal提供服务的.后来逐渐被越来越多的大型站点所採用.用于在应用中减少对数据库 ...

  6. spring mvc异常的处理

    1.全局处理 <!-- 总错误处理 --> <bean id="exceptionResolver" class="org.springframewor ...

  7. 14、Java中用浮点型数据Float和Double进行精确计算时的精度问题

    一.浮点计算中发生精度丢失 大概很多有编程经验的朋友都对这个问题不陌生了:无论你使用的是什么编程语言,在使用浮点型数据进行精确计算时,你都有可能遇到计算结果出错的情况.来看下面的例子. // 这是一个 ...

  8. Loadrunner脚本编程(1)-大体思路

    http://www.360doc.com/content/10/0806/13/1698198_44076570.shtml 就目前的了解.Loadrunner的脚本语言其实和C没什么区别.他内部的 ...

  9. linux YUM常用 命令

    语法 yum(选项)(参数) 选项 -h:显示帮助信息: -y:对所有的提问都回答“yes”: -c:指定配置文件: -q:安静模式: -v:详细模式: -d:设置调试等级(0-10): -e:设置错 ...

  10. java 移位

    java中没有2进制的数据类型,对二进制的操作,需要使用三种操作符 << 左移位操作符,算数左移           用来将一个数的二进制位序列左移若干位,高位左移后溢出,舍弃不用,右补0 ...