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. JBoss AS 7之基本配置和部署(The Return Of The King)

    1.4 JBoss As 7基本配置 1.4.1 IP訪问控制 因默认情况下,jboss仅可通过127.0.0.1和localhost来訪问.假设你想局域网中的其他IP来訪问,你能够在standalo ...

  2. java RandomAccessFile类(随机访问文件)

    该类可以实现对同一个文件的读写操作,与其他IO流不同的是可以指定读写指针的脚标(seek),有跳过指定个数字节(skipBytes)操作. 另外该类也可用于断点续传. 简单示例如下: import j ...

  3. Linux服务器修改时区时间

    时间的一致性很关键,对于日志的分析和程序的对接都至关重要! 01.tzselect 修改时区 可以使用命令 tzselect,修改时区.操作示例: $ tzselect Please identify ...

  4. bzoj1296【SCOI2009】粉刷匠

    1296: [SCOI2009]粉刷匠 Time Limit: 10 Sec  Memory Limit: 162 MB Submit: 1479  Solved: 837 [id=1296" ...

  5. linux下使用speedtest测速

    Speedtest测试网络上传/下载速度还是挺不错的,windows下非常方便.Linux下也可以很方便的使用命令行speedtest来测试.speedtest是一个用Python编写的轻量级Linu ...

  6. ASP.NET#LinqDataSource控件配置对象模型时遇到的问题

    使用LinqDataSource控件时,配置数据源的时候,发现没有DataContext对象可选,但已通过可视化操作完成了对象模型的建立.这个时候,可以通过现在Default.aspx.cs文件中做如 ...

  7. Linux命令-统计文件中的字节数、字数、行数:wc

    Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项]文件... 2.命令功能: 统计指定文件中的字节数. ...

  8. Spring.net(一)----Spring.NET框架简介及模块说明

    简介:    Spring.NET框架包括很多功能,Spring.NET 1.0包括完整的IoC容器和AOP类库.1.1版加入Web.ORM和数据模块.Spring.NET的下载包中并不包含与其它类库 ...

  9. C++:借助tinyxml2读取XML文件

    // XMLT01.cpp : 定义控制台应用程序的入口点.//#include "stdafx.h"#include <iostream>#include " ...

  10. 关闭VS的实时调试器

    今天要安装一个水晶报表.安装过程有几个文件有错误.结果这个vs的实时调试器老是调出来.而且还是5次跳出来等你取消5次之后,才到默认的忽略的界面.你知道有多烦的,还得看这他,点完一次还要等几秒钟.差点崩 ...