zoukankan      html  css  js  c++  java
  • oracle学习循环语句

    oracle学习--循环语句


    loop循环:
    create or replace procedure pro_test_loop is
    i number;
    begin
    i:=0;
    loop
      i:=i+1;
      dbms_output.put_line(i);
      if i>5 then
        exit;
      end if;
    end loop;
    end pro_test_loop;

    while循环:
    create or replace procedure pro_test_while is
    i number;
    begin
    i:=0;
    while i<5 loop
      i:=i+1;
      dbms_output.put_line(i);
    end loop;
    end pro_test_while;

    for循环1:
    create or replace procedure pro_test_for is
    i number;
    begin
    i:=0;
    for i in 1..5 loop
      dbms_output.put_line(i);
    end loop;
    end pro_test_for;

    for循环2:
    create or replace procedure pro_test_cursor is
    userRow t_user%rowtype;
    cursor userRows is
    select * from t_user;
    begin
    for userRow in userRows loop
        dbms_output.put_line(userRow.Id||','||userRow.Name||','||userRows%rowcount);
    end loop;
    end pro_test_cursor;
  • 相关阅读:
    node.js入门
    分布式爬虫
    ES6入门
    Vue.js入门
    用scrapy爬取亚马逊网站项目
    垃圾回收器
    HTTP协议详解
    有效的邮箱地址
    C#中正则表达式的使用
    抽象类
  • 原文地址:https://www.cnblogs.com/happyday56/p/793102.html
Copyright © 2011-2022 走看看