IF条件

declare

cursor s is 

          select version from city_server t;

  s_ city_server.version%type;

begin

  open s;

  fetch s into s_;

        if s_>2 

          then

        DBMS_OUTPUT.put_line(s_);

        end if;

  close s;

end;

LOOP循环
declare 

  cursor s is 

          select version from city_server t;

  s_ city_server.version%type;

begin

  open s;

  loop

      fetch s into s_;

        exit when s%notfound;

        DBMS_OUTPUT.put_line(s_);

  end loop;

  close s;

end;

PL/SQL个人学习笔记(二)的更多相关文章

  1. postgreSQL PL/SQL编程学习笔记(二)

    Control Structures of PL/SQL Control structures are probably the most useful (and important) part of ...

  2. postgreSQL PL/SQL编程学习笔记(六)——杂七杂八

    1 PL/pgSQL Under the Hood This part discusses some implementation details that are frequently import ...

  3. postgreSQL PL/SQL编程学习笔记(三)——游标(Cursors)

    Cursors Rather than executing a whole query at once, it is possible to set up a cursor that encapsul ...

  4. postgreSQL PL/SQL编程学习笔记(一)

    1.Structure of PL/pgSQL The structure of PL/pgSQL is like below: [ <<label>> ] [ DECLARE ...

  5. postgreSQL PL/SQL编程学习笔记(五)——触发器(Triggers)

    Trigger Procedures PL/pgSQL can be used to define trigger procedures on data changes or database eve ...

  6. postgreSQL PL/SQL编程学习笔记(四)

    Errors and Messages 1. Reporting Errors and Messages Use the RAISE statement to report messages and ...

  7. PL/SQL个人学习笔记

    资料1 -- Created on 2014/8/20  declare    -- Local variables here   i integer; begin   i := 12;   -- T ...

  8. 《SQL必知必会》学习笔记二)

    <SQL必知必会>学习笔记(二) 咱们接着上一篇的内容继续.这一篇主要回顾子查询,联合查询,复制表这三类内容. 上一部分基本上都是简单的Select查询,即从单个数据库表中检索数据的单条语 ...

  9. Django学习笔记二

    Django学习笔记二 模型类,字段,选项,查询,关联,聚合函数,管理器, 一 字段属性和选项 1.1 模型类属性命名限制 1)不能是python的保留关键字. 2)不允许使用连续的下划线,这是由dj ...

随机推荐

  1. java中float/double浮点数的计算失精度问题(转)

    如果我们编译运行下面这个程序会看到什么? public class Test  {    public static void main(String args[]) {                ...

  2. MVC常用特性

    MVC常用特性使用   简介 在以前的文章中,我和大家讨论如何用SingalR和数据库通知来完成一个消息监控应用. 在上一篇文章中,我介绍了如何在MVC中对MongoDB进行CRUD操作. 今天,我将 ...

  3. Gradle多项目配置的一个demo

    ParentProject├─build.gradle├─settings.gradle├─libs├─subProject1├────────────build.gradle├─────────── ...

  4. 正则、grep、sed、awk

    每次用到正则都要蛋疼一下,索性总结一下在这里. 正则 正則表達式主要分为基础正则和扩展正则.注意,正则和一般命令行输入的命令的通配符不同.正则仅仅使用于支持这样的表示法的工具,如:vi,grep,se ...

  5. hdu1115(重力算法的多边形中心)

    标题的含义: 给定一个n刚n顶点.这是获得n分众协调多边形. http://acm.hdu.edu.cn/showproblem.php? pid=1115 题目分析: /** *出处:http:// ...

  6. win8 metro 调用摄像头拍摄照片并将照片保存在对应的位置

    刚刚做过这类开发,所以就先献丑了,当然所贴上的源代码都是经过验证过的,已经执行成功了,希望能够给大家一些借鉴: 以下是metro UI代码: <Page x:Class="Camera ...

  7. 【CTO辩论】移动创业大军:谁斗争or变更代理

    众创时代.英雄辈出. 但千军万马过独木桥,竞争厮杀也异常残酷.有人说,这个时代不宜创业,由于技术门槛高了.推广难度高了.盈利模式没了.创业变重了.玩法变了...... 也有人说,时势造英雄.天时地利人 ...

  8. NET MVC

    NET MVC 1.为 Action 标注 Attribute 限制访问 public class HomeController : Controller { [HttpPost] public Ac ...

  9. 使用nodeitk进行对象识别

    前言 东莞,晴,29至27度.忙了一天,最终能够写写东西了.今天继续昨天的话题,我们在昨天的例了基础上完好,通过匹配关键点求出映射从而找到场景中的已知对象. 目标 本文你将学习 採用nodeitk的f ...

  10. 漫游Kafka实战篇clientAPI

    原文地址:http://blog.csdn.net/honglei915/article/details/37697655 Kafka Producer APIs 旧版的Procuder API有两种 ...