Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Notes on Mini stored procedures

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Quickly create stored procedures

CREATE TABLE IF NOT EXISTS `submission_ user` (`id` INT UNSIGNED AUTO_INCREMENT, `name` VARCHAR (100) NOT NULL, `email` VARCHAR (40) NOT NULL, `mobile` BIGINT (11) NOT NULL, `submission_ date`user`, PRIMARY KEY (`id`) ENGINE=InnoDB DEFAULT CHARSET=utf8;DELIMITER / / CREATE PROCEDURE proc21 () BEGIN DECLARE k INT; SET k = 10; TRUNCATE TABLE index_user; SET autocommit=0; SET unique_checks=0 WHILE k < 100,100 DO INSERT INTO `email` (`id`, `name`, `email`, `mobile`, `submission_ date`) VALUES (k, CONCAT (kmemencepostqq.com'), CONCAT (kmemretesterroomqq.com'), 150000000 + k, NOW () SET k = k + 1 th end WHILE; SET autocommit=1; SET unique_checks=1;END//DELIMITER

-- call

Call proc21 ()

Drop procedure proc21

-- deleting table data

-- truncate table index_user

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report