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. Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only

    Mount 挂载错误mount:block device /dev/sr0 is write – protected , mounting read-only 安装虚拟机出现以下提示: mount:b ...

  2. STS 控制台 中文乱码(maven 中文乱码)

    用uriEncoding标签设置中文字符集就行了 <plugin> <groupId>org.apache.tomcat.maven</groupId> <a ...

  3. 新浪API及调用案例

    百度分享:http://pan.baidu.com/s/1uSmku

  4. 如何查询端口号和网址的ip地址?

    import socket print socket.gethostname()#主机名 hostname=socket.gethostname() #传递主机名 print socket.getho ...

  5. Oracle PUP(PRODUCT_USER_PROFILE)配置和使用

    近期在翻Oracle SQLPLUS官方文档,在讲SQLPLUS Security章节介绍了PUP这个机制.借此.我来使用下面: PUP(PRODUCT_USER_PROFILE)介绍   PRODU ...

  6. easyui panel自适应问题

    项目中要用到easyui,使用也有几年时间了,刚开始使用还不错,毕竟只是简单的增删改查数据,不过到后面越来越觉得easyui不如extjs了,好多复杂一点的问题,easyui表现就力不从心了,题外话就 ...

  7. WPF基础学习第一天

    格式 1.XAML格式: <Button x:Name="btnClick" Content="按钮" HorizontalAlignment=" ...

  8. ArchLinux安装 LXDE

    http://wiki.lxde.org/zh/index.php?title=ArchLinux&variant=zh-cn 透过 pacman 安装 LXDE 大多数的最新 LXDE 套件 ...

  9. 【LeetCode】149. Max Points on a Line

    Max Points on a Line Given n points on a 2D plane, find the maximum number of points that lie on the ...

  10. javaBean与map类型相互转换

    /** * 把Map键值对转化为javaBean对象 * * @param type * @param map * @return * @throws Exception */ private Obj ...