mysql循环

drop PROCEDURE p16;
 create procedure p16()
    begin
       declare v int;
       set v=0;
       LOOP_LABLE:loop
          INSERT into AAA VALUES(null, 1, 1, 'AAA', 'BBB', 1, 3, UNIX_TIMESTAMP());
       set v=v+1;
       if v >=1000000 then
          leave LOOP_LABLE;
       end if;
       end loop;
    end;
 

 call p16();


补充:

           //printf("name:%s, type:%d,  length:%lu, max_length:%lu\n", field->name, field->type, field->length, field->max_length);
            //     //field->length该字段类型所支持的最大长度;field->max_length该字段当前查询结果数据中存在的最大长度

你可能感兴趣的:(mysql循环)