zoukankan      html  css  js  c++  java
  • oracle 数据库 if...elsif...语句

    CREATE OR REPLACE FUNCTION "UFN_GETIDS" (    OPEKIND   IN   VARCHAR2,-- 查询类型    PARAMS IN VARCHAR2-- 查询字段 ) RETURN clob IS    str_return  clob;--varchar2(30000);  

    BEGIN      if      OPEKIND = '1'   then        declare              Cursor cusor1 is  SELECT   ………………;         begin                  for x in cusor1 loop                 str_return := str_return || x.OUID || ',';               end loop;               end;  

    elsif      OPEKIND = '2'   then     declare              Cursor cusor1 is  SELECT  ……………………;                 begin                  for x in cusor1 loop                 str_return := str_return || x.OILDOMID || ',';               end loop;      str_return:= substr(str_return,0,length(str_return)-1);               end;

      elsif      OPEKIND = '3'   then     declare              Cursor cusor1 is  SELECT   ………………;                           begin                  for x in cusor1 loop                 str_return := str_return || x.OILDOMID || ',';               end loop;      str_return:= substr(str_return,0,length(str_return)-1);               end;  

    elsif      OPEKIND = '4'   then     declare              Cursor cusor1 is  SELECT   ……………………;                           begin                  for x in cusor1 loop                 str_return := str_return || x.OILDOMID || ',';               end loop;      str_return:= substr(str_return,0,length(str_return)-1);               end;

      elsif      OPEKIND = '5'   then     declare              Cursor cusor1 is  SELECT   …………………………;                           begin                  for x in cusor1 loop                 str_return := str_return || x.OILDOMID || ',';               end loop;       str_return:= substr(str_return,0,length(str_return)-1);               end;  end if;

    RETURN   str_return;       END;

           

  • 相关阅读:
    C#生成MD5的方法
    平常心是道
    Android 三种动画的使用 – Tween Animation
    17个Javascript日期选择器
    Javascript解码编码常用函数
    mysql 命令行导入导出数据
    技术驱动还是产品驱动
    Ubuntu 和 Redhat / Fedora 服务管理命令对比表
    jquery常用技巧
    Fedora 17安装JDK1.7
  • 原文地址:https://www.cnblogs.com/xuxin-1989/p/4073667.html
Copyright © 2011-2022 走看看