티스토리 뷰

Development/Database & SQL

[MySQL] loop 프로시저

쥬리리리 2021. 8. 22. 23:54
delimiter $$
create procedure metaDataInsert()
begin
  SET @i = 0;
  while @i < 100 DO
    insert into METATBL (META) VALUE (@i);   
    set @i = @i + 1;
  end while;
END; $$

//drop
drop procedure if exists metaDataInsert;

//call
call metaDataInsert();
댓글
링크
최근에 올라온 글
Total
Today
Yesterday