zoukankan      html  css  js  c++  java
  • 存储过程 插入主表

    drop procedure sert5;
    delimiter //
    create procedure sert5()
    begin 
    declare i_str char(10);
    declare j_str char(10);
    declare k_str char(10);
    declare m_str char(10);
    declare i int;
    declare j int;
    declare k int;
    declare m int;
    set i=1;
    set j=1;
    set k=1;
    set m=1;
    delete from class;
    delete from detailss;
    while i <= 99 do 
      set i_str = right(concat('00',i),2);
      set i=i+1;
      insert into class(id,current_code,total_code) values(i_str,1,4);
      set j = 1;
      while j <= 5 do
        set j_str = right(concat('00',j),2);
        set j_str = concat(i_str,j_str);
        insert into class(id,current_code,total_code) values(j_str,2,4);
        set j=j+1;
        set k=1; 
        while k <= 5 do
    	   set k_str =concat('000000',k);
           set k_str =right(k_str,6);
    	   set k=k+1;
           set k_str =concat(j_str,k_str);
           insert into class(id,current_code,total_code) values(k_str,3,4);
        end while;
      end while; 
    end while;
    end//
    delimiter ;
    

      

  • 相关阅读:
    Vue(知识讲解)
    爬虫框架:scrapy
    爬虫性能相关
    MongoDB
    Beautifulsoup模块
    selenium模块
    requests模块
    爬虫(集锦)
    爬虫目录
    Flask目录
  • 原文地址:https://www.cnblogs.com/yuchunju/p/2531018.html
Copyright © 2011-2022 走看看