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. LeetCode——Climbing Stairs

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...

  2. Sql中联合查询中的”子查询返回的值不止一个“的问题

    在子查询中,如果想实现如下的功能: select lib,count(*),select sum(newsNo) from Table1 group by lib from Tabel1 T1,Tab ...

  3. Android 通过应用程序来设置系统的日期和时间中的

    Android 通过应用程序来设置系统的日期和时间中的 android 2.3 android 4.0 测试可行,刚需ROOT权限. import java.io.DataOutputStream; ...

  4. 淘宝异构数据源数据交换工具 DataX

    淘宝异构数据源数据交换工具 DataX 阅读目录 DataX是什么? DataX用来解决什么? DataX特点? DataX结构模式(框架+插件) DataX在淘宝的运用 DataX是什么? Data ...

  5. ASP.Net中使用XMLDataSource

    在Web开发中,程序和数据库打交道是常有的事情.在平时使用过程中,使用较多的是MS SQLSERVER,因此经常用到SQLDataSource将数据绑定的数据控件上.有时数据量较小,无需要在数据库中创 ...

  6. c# Ftp下载程序源代码解析

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. Session中StateServer的使用方法

    最近项目中用到 Session的StateServer模式,我们知道sessionState有四种模式:off,inProc,StateServer,SqlServer. 而StateServer 是 ...

  8. git merge简介(转)

    git merge的基本用法为把一个分支或或某个commit的修改合并现在的分支上.我们可以运行git merge -h和git merge --help查看其命令,后者会直接转到一个网页(git的帮 ...

  9. python 导入库问题

    最终解决如下面:我不知道有没有多余的空间 from django.conf import settings from sys import path path.extend(['/home/zoues ...

  10. groovy install,gvm,groovysh简述(转)

    1.1 安装Groovy Groovy主页:http://www.groovy-lang.org 确保本地系统安装了Java 1.1.1 在Windows系统上安装Groovy 1.创建环境变量GRO ...