declare

    Type ref_cur_variable IS REF cursor;
cur_variable ref_cur_variable; v_ename varchar2(10);
v_deptno number(2);
v_sal number(7,2); v_sql varchar2(100) := 'select t.ename, t.deptno, t.sal from scott.emp t'; begin Open cur_variable For v_sql; Loop
fetch cur_variable
InTo v_ename, v_deptno, v_sal;
Exit When cur_variable%NotFound;
dbms_output.put_line(cur_variable%rowcount || ' -> ' || v_ename ||
' ' || v_deptno || ' ' || v_sal);
End Loop;
Close cur_variable; end;

Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]的更多相关文章

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

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

  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. 转: 在hibernate中查询使用list,map定制返回类型

    在使用hibernate进行查询时,使用得最多的还是通过构建hql进行查询了.在查询的过程当中,除使用经常的查询对象方法之外,还会遇到查询一个属性,或一组聚集结果的情况.在这种情况下,我们通常就需要对 ...

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

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

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

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

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

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

随机推荐

  1. iOS——Quartz2D

    0. 复习. 1.基本图形绘制 * 线段(线宽.线段样式) * 矩形(空心.实心.颜色) * 三角形.四边形等形状 1> 说明 - (void)drawRect:(CGRect)rect 什么时 ...

  2. Websocket——Websocket原理

    偶然在知乎上看到一篇回帖,瞬间认为之前看的那么多资料都不及这一篇回帖让我对 websocket 的认识深刻有木有.所以转到我博客里,分享一下.比較喜欢看这样的博客,读起来非常轻松.不枯燥,没有布道师的 ...

  3. filezilla

    中文网站:https://www.filezilla.cn/ 英文网站:https://filezilla-project.org/ FileZilla 客户端是一个快速可靠的.跨平台的FTP,FTP ...

  4. LightOj 1123-Trail Maintenance(最小生成树:神级删边)

    1123 - Trail Maintenance PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB ...

  5. 解决sqlplus: command not found

    export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product//db_1 su - root ln -s $OR ...

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

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

  7. 12、static final

    Java中修饰常量用static final 用static final同时修饰的变量只能是成员变量而不能是局部变量 初始化: ①:定义时赋值 ②:静态代码块static{}中赋值 static 和 ...

  8. CentOS 查看系统版本号

    查看centos版本: cat /etc/issuecat /etc/redhat-release 查看系统位数: getconf LONG_BIT 查看内核版本: uname -r cat /pro ...

  9. Tomcat servers.xml 无注释版

    <?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOW ...

  10. Web在线文件管理器(web os) KODExplorer

    KODExplorer是款开源的Web在线文件管理.代码编辑器.它提供了类windows经典用户界面,一整套在线文件管理.文件预览.编辑.上传下载.在线解压缩.音乐播放功能.让你直接在浏览器端实现we ...