declare
v_empno scott.emp.empno%type;
v_sal scott.emp.sal%type;
cursor cur_emp is
select t.empno, t.sal from scott.emp t; begin open cur_emp; loop
fetch cur_emp
into v_empno, v_sal; exit when cur_emp%notfound; dbms_output.put_line(v_empno || ' ' || v_sal); end loop; close cur_emp; end;

Oracle PLSQL Demo - 08.定义显式游标[Define CURSOR, Open, Fetch, Close CURSOR]的更多相关文章

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

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

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

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

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

  4. Oracle PLSQL Demo - 12.定义包体[Define PACKAGE BODY]

    CREATE OR REPLACE PACKAGE BODY temp_package_demo is FUNCTION f_demo(userid NUMBER) RETURN BOOLEAN IS ...

  5. Oracle PLSQL Demo - 11.定义包头[Define PACKAGE]

    CREATE OR REPLACE PACKAGE temp_package_demo is v_demo ); PROCEDURE p_demo_1(userid NUMBER DEFAULT v_ ...

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

  7. Oracle PLSQL Demo - 01.定义变量、打印信息

    declare v_sal ) :; begin --if you could not see the output in console, you should set output on firs ...

  8. 【Oracle】PL/SQL 显式游标、隐式游标、动态游标

    在PL/SQL块中执行SELECT.INSERT.DELETE和UPDATE语句时,Oracle会在内存中为其分配上下文区(Context Area),即缓冲区.游标是指向该区的一个指针,或是命名一个 ...

  9. plsql 显式游标

    显式游标的处理过程包括: 声明游标,打开游标,检索游标,关闭游标. 声明游标 CURSOR c_cursor_name IS statement; 游标相当于一个查询结果集,将查询的结果放在游标里,方 ...

随机推荐

  1. javaweb项目打成war包

    进入项目文件 jar -cvf newsisAP.war *

  2. struts2接收参数的几种形式

    1.使用属性 HTML: <form action="login" method="post" name="form1"> 用户 ...

  3. CameraManager与CameraDevice与ICameraService的相应关系

    Camera2 AP Framewok中有三个比較重要的组件:CameraManager.CameraDevice.ICameraService,他们的相应关系例如以下: 一个Context中会有一个 ...

  4. Linux下一个简单守护进程的实现 (Daemon)

    在Linux/UNIX系统引导的时候会开启很多服务,这些服务称为守护进程(也叫Daemon进程).守护进程是脱离于控制终端并且在后台周期性地执行某种任务或等待处理某些事件的进程,脱离终端是为了避免进程 ...

  5. 深入了解PHP闭包的使用以及实现

    一.介绍 匿名函数(Anonymous functions),也叫闭包函数(closures),允许 临时创建一个没有指定名称的函数.最经常用作回调函数(callback)参数的值.当然,也有其它应用 ...

  6. JS版的Server.UrlEncode

    <script>function (str) {//标准UrlEncode.execScript("function reHex(str)\reHex=hex(asc(str)) ...

  7. jsp中获取当前项目名称

    在JSP页面获取当前项目名称的方法: 方法1: <%= this.getServletContext().getContextPath() %> 方法2: 使用EL表达式 ${pageCo ...

  8. 【LeetCode】129. Sum Root to Leaf Numbers (2 solutions)

    Sum Root to Leaf Numbers Given a binary tree containing digits from 0-9 only, each root-to-leaf path ...

  9. OGG_GoldenGate日常维护(案例)

    2014-03-12 Created By BaoXinjian

  10. mark Pay http://git.oschina.net/littleCrazy/dianshangpingtai-zhifu/blob/master/OrderPayController

    @Controller @RequestMapping("/api/pay/") public class OrderPayController extends BaseContr ...