zoukankan      html  css  js  c++  java
  • PLSQL程序流程

     

    IF语句结构:

       if(条件表达式)-

         -then-

         -执行语句;-

       -end;

    IF-THEN-ELSE语句结构:

       if(条件表达式)-

        -then-

        -执行语句;-

    -else-

    -执行语句;-

       end;

    ELSIF语句:

       if(条件表达式)-

        -then-

        -执行语句;-

    -elsif-

    -执行语句;-

    -elsif-

    -执行语句;-

    -else-

    -执行语句;-

       end;

    注意:elsif语句是顺序执行的,各个执行条件之间是互斥的关系,在使用该语句是需要注意条件的顺序关系。

    IF嵌套:

       if(条件表达式)-

    -then-

     (-执行语句;-)

     If (条件表达式)-

       -then

       -执行语句;-

       -else-

       -执行语句;-

     end;

       -else-

        -then-

        -执行语句;-

       end;

    CASE语句:

    Case 的两种行为方式。

    一,简单的case语句,case  选择器 when  xxx  then  xxx

    二,搜索式  case  when xxx then xxx 这个是没有选择器的。

    循环控制语句:

    1.基本循环机构:

      loop

    执行语句

      end loop;

    2.While循环:

      while vars<=12 loop

    执行语句;

      end loop;

    3.for循环:

      for i in 1..10 loop

    执行语句;

      end loop;

      i1-10循环执行

    中断控制

    exit 退出 ②exit when(先执行在判断)

    顺序控制

    continue 继续 ②continue when(先执行在判断)

    NULL语句:

     Null是一种判断语句,在流程控制中,意味着什么也不做

     If name=’sun’

      then

       dbms_output.put_line(‘name=’||name);

      else

       null;--

       Null起到了屏蔽异常的作用,不需要处理异常的场合就可以使用null不做任何事情。

     end;

  • 相关阅读:
    [component]button skin–按钮组件外观
    as3 图片平滑方法
    SOLVED: Right Click in AS3
    一个超高效的不规则物体碰撞检测的类
    flex中的css应用
    控制时间间隔
    用flash cs3美化flex3之skin开发
    AS3实现RPG游戏鼠标8方向操作
    log4net basic example write to file
    观察者模式(C#实现 + eventhandler)
  • 原文地址:https://www.cnblogs.com/sun-chao/p/6343623.html
Copyright © 2011-2022 走看看