DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn2008`.`proc_start`(IN v_proc_id INT) BEGIN INSERT INTO stat(proc_id) VALUES(v_proc_id); DROP TEMPORARY TABLE IF EXISTS lastid; CREATE TEMPORARY TABLE lastid SELECT last_insert_id() id; END$$ DELIMITER ;