zoukankan      html  css  js  c++  java
  • pl/sql 实例精解 06

    1. 简单循环

       1:  LOOP
       2:    statement1;
       3:    statement2;
       4:    EXIT WHEN condition;
       5:  END LOOP;
       6:  statement3;

    也可以使用 IF 语句来限制 exit 的条件.

    if condition then

      exit;

    end if;

    2. while 循环

       1:  while condition loop
       2:    statement1;
       3:    statement2;
       4:    ...
       5:    statementN;
       6:  end loop;

    3. FOR 数值型循环

       1:  FOR loop_counter IN [REVERSE] lower_limit .. upper_limit LOOP
       2:    statement1;
       3:    statement2;
       4:    ...
       5:    statementN;
       6:  END LOOP;

    reverse: 是 5,4,3,2,1 这样倒序

    注意: 可以在循环体内使用 IF condition then exit 来提前终止循环, 但是这不是好的编程习惯.

  • 相关阅读:
    mysql查看所有触发器以及存储过程等操作集合【转】
    Hutool之Http工具类使用
    SpringCloud之Sentinel
    SpringCloud之Gateway
    com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
    [AWS DA Guru] SQS
    [AWS DA Guru] Kinesis
    [AWS DA Guru] SNS & SES
    [Typescript] Prevent Type Widening of Object Literals with TypeScript's const Assertions
    [AWS] Updating Elastic Beans Talks & RDS
  • 原文地址:https://www.cnblogs.com/moveofgod/p/3652116.html
Copyright © 2011-2022 走看看