DELIMITER $$
-- If the procedure already exists, delete it
DROP PROCEDURE IF EXISTS SAVERANDDATA;
-- Create procedure name
CREATE PROCEDURE SAVERANDDATA()
BEGIN
DECLARE i INT;
SET i = 0;
-- Defining the MYSQL REPEAT Statement
REPEAT
-- SQL content
INSERT INTO `lzhstore`.`almart_all` (
`date_key`,
`hour_key`,
`client_key`,
`item_key`,
`account`,
`expense`
)
VALUES
(
"2016-05-01",
FLOOR(RAND() * 24),
FLOOR(RAND() * 1000000) + 1,
FLOOR(RAND() * 100000) + 1,
FLOOR(RAND() * 20) + 1,
FLOOR(RAND() * 10000) + 1
);
SET i = i + 1;
-- Ends the loop if executed one million times
UNTIL i = 1000000 END REPEAT;
END $$
CALL SAVERANDDATA();
Read More:
- Android: How to Add Background Music for Activity with Service
- Flutter & Dart Enumeration Example
- Android: How to get the size of font you set (Example Code)
- torch.max Example (How to Use)
- MAFIA: 1- OpenFlow statistics (Counters, Timestamps)(mafia-sdn/p4demos/demos/1-openflow/1.1-statistics/p4src/of.p4)
- Opentelemetry + Jaeger Python Version Cross Service Call Example
- File class details (get the file name, size, path, create, etc.)
- Docker: How to build a rabbitmq image cluster
- Hutool Excel Import & Export Example
- Python: How to Create List by Comprehension (Example Codes)
- How to Use Printf in HAL Library
- Windows Core Audio APIs: How to Progress Loopback Recording and Generate WAV File
- C#: How to Get details of the directory where the currently running program is located
- Adobe ColdFusion Files Read Vulnerability (CVE-2010-2861)
- Websocket Front-end Call Example
- Electron: How to Use BrowserWindow to Create a Window
- WCNSS_qcom_cfg.ini WIFI Configuration File Guide
- Canvas: How to Implement Video Screenshot Function
- MultipartFile Upload an Image Example