zoukankan      html  css  js  c++  java
  • oracle批量增加数据

    记工作需要用到的一个批量插入数据的脚本。

    declare
    code_ number(10) := 100000;
    num_ number(10) := 2000000;
    error_message exception;
    begin
    for i in 100 .. 1000 loop
    num_ := num_ + 1;
    code_ := code_ + 1;
    insert into tpj_gf_ma_invoiceinfo
    values
    (i,
    num_,
    code_,
    );
    end loop;
    commit;
    end;

    再次改进:

    declare
    code_ number(10) := 100000;
    num_ number(10) := 2000000;
    error_message exception;
    begin
    for j in 1 .. 4 loop
    for i in 100 .. 1000 loop
    num_ := num_ + 1;
    code_ := code_ + 1;
    insert into tpj_gf_ma_invoiceinfo
    values
    (i,
    num_,
    code_,
    '6',
    '',
    '',
    '',
    'test',

    '0',
    '',
    '未使用');
    end loop;
    end loop;
    for j in 1 .. 6 loop
    for i in 100 .. 1000 loop
    num_ := num_ + 1;
    code_ := code_ + 1;
    insert into tpj_gf_ma_invoiceinfo
    values
    (i,
    num_,
    code_,
    '6',
    '600',
    '99400',
    '111000',
    'test',
    '0',
    '123665488',
    '',
    '未使用');
    end loop;
    end loop;
    commit;
    end;

  • 相关阅读:
    git使用
    silverlight与wcf双向通讯 例子
    Oracle 存储过程
    C# 视频教程
    佩服的技术大牛 “赵劼”
    setTimeout setInterval
    js闭包
    MVC Razor视图引擎控件
    MVC json
    springboot创建多环境profile打包
  • 原文地址:https://www.cnblogs.com/LinxiHuang/p/9245901.html
Copyright © 2011-2022 走看看