declare

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

Oracle PLSQL Demo - 17.游标查询个别字段(非整表)的更多相关文章

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

  2. SQL Server查询某个字段存在哪些表中

    一.查询SQL Server中所有的表 SQL语句:SELECT * FROM sys.tables name列表示所有的表名. 二.查询SQL Server中所有的列 SQL语句:SELECT * ...

  3. oracle赋予一个用户具有查询另一个用户所有表数据

    一  以需要被查询的用户登录oracle(假如为A)   B为要查询A用户下的表的用户 二  执行查询语句: select 'grant select on A.'|| tname ||' to  B ...

  4. Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...

  5. Oracle PLSQL Demo - 18.02.管道function[查询零散的字段组成list管道返回] [字段必须对上]

    --PACKAGE CREATE OR REPLACE PACKAGE test_141215 is TYPE type_ref IS record( ENAME ), SAL )); TYPE t_ ...

  6. Oracle PLSQL Demo - 18.01管道function[查询零散的字段组成list管道返回]

    --PACKAGE CREATE OR REPLACE PACKAGE test_141213 is TYPE type_ref IS record( ENAME ), WORK_CITY ), SA ...

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

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

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

  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. 移动端网页宽度值(未加meta viewport标签)

    移动端网页宽度值(未加meta viewport标签): iphone:980px Galaxy(盖乐世):980px Nexus:980px blackberry(黑莓):980px LG:980p ...

  2. Druid register mbean error

    key: [com.alibaba.druid.stat.DruidDataSourceStatManager.addDataSource(DruidDataSourceStatManager.jav ...

  3. HDUOJ---1195Open the Lock

    Open the Lock Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  4. HDUOJ------(1272)小希的迷宫

    小希的迷宫 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Subm ...

  5. supervisor+gunicorn部署python web项目

    有了Nginx,对于Tomcat没有必要详细了解. 有了supervisor,再也没有必要把一个程序设置成服务.驻留进程,supervisor真是一个相见恨晚的好工具. 在Tomcat中,所有的web ...

  6. javascript高级程序设计第二章

    看后总结: 1.js代码用得最多的两种加载方式: a)外部文件形式:<script type="text/javascript" src="jquery.min.j ...

  7. Redis的Docker镜像

    原文地址:https://hub.docker.com/_/redis/ Pull Command docker pull redis Short Description Redis is an op ...

  8. 【ERROR】bash: vim: command not found的解决办法

    今天在学习鸟哥的菜的时候,发现自己linux不可以启用vim命令,错误为:bash: vim: command not found. 机器环境:VMWare8+RED HAT Enterprise5 ...

  9. if you are not making someone else's life better, then you are wasting your time.– Will Smith如果你不能给别人的生活带来改善,那么你就是在浪费你的宝贵时间。 --威尔 史密斯(程序员,你做的东西...)

    if you are not making someone else's life better, then you are wasting your time. – Will Smith 如果你不能 ...

  10. python学习笔记—— 多进程中的 孤儿进程和僵尸进程

    1 基本概述 1.1 孤儿进程和僵尸进程 父进程创建子进程后,较为理想状态是子进程结束,父进程回收子进程并释放子进程占有的资源:而实际上,父子进程是异步过程,两者谁先结束是无顺的,一般可以通过父进程调 ...