DROP PROCEDURE test_insert ;
DELIMITER ;;
CREATE PROCEDURE test_insert ()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE i<500000
DO
INSERT INTO pay_log_1
(
num,
source_key,
card_no,
create_time,
change_time,
change_ps,
tvid,
device_id
)
VALUES
(
'1',
'1',
'',
'',
'2014-11-11 11:54:30',
'2014-11-11 11:54:30',
'',
'',
''
);
SET i=i+1;
END WHILE ;
DELIMITER ;;
CREATE PROCEDURE test_insert ()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE i<500000
DO
INSERT INTO pay_log_1
(
num,
source_key,
card_no,
create_time,
change_time,
change_ps,
tvid,
device_id
)
VALUES
(
'1',
'1',
'',
'',
'2014-11-11 11:54:30',
'2014-11-11 11:54:30',
'',
'',
''
);
SET i=i+1;
END WHILE ;
END;;
调用存储过程
] CALL test_insert();