Mysql transfers data from one table to another. Stored PROCEDURE: DELIMITER $ www.2cto.com USE 'ms' $ drop procedure if exists 'sendsmsprocs '$ create definer = 'root' @ 'localhost 'processed' sendSmsProcs '(numberArrayId CHAR (32 ), longSmsId CHAR (32) BEGIN/* CREATE a temporary table and place the data in the TEMPORARY group to be issued */create temporary table tmp_table (phonenumber CHAR (11) TYPE = HEAP; truncate table tmp_table; create unique index tmp_table_index ON tmp_table (phonenumber); www.2cto.com/* put INTO temporary group data */insert into tmp_table SELECT phoneNumber FROM smsallphone WHERE smsallphone. numberArrayId = numberArrayId; select count (*) FROM tmp_table;/* CREATE a temporary table to query the existing number in the large TABLE */create temporary table tmp_table2 (phonenumber CHAR (11 )) TYPE = HEAP; truncate table tmp_table2; create unique index tmp_table2_index ON tmp_table2 (phonenumber);/* put the existing user number in the temporary data to be sent TABLE */insert into tmp_table2 SELECT region FROM tmp_table, smssystem WHERE tmp_table.phonenumber = smssystem. phoneNumber; select count (*) FROM tmp_table2;/* DELETE existing data to be published */delete from tmp_table WHERE tmp_table.phonenumber IN (SELECT phonenumber FROM tmp_table2 ); insert into smssystem SELECT replace (uuid (), '-', ''), longSmsId, phonenumber, sysdate (), sysdate (), 0, 0 FROM tmp_table; END $ DELIMITER;