DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`makeNewItem`() BEGIN DECLARE newItemFk INT; SELECT getNewItemId() INTO newItemFk; INSERT INTO item(id,name,typeFk,originFk) SELECT newItemFk, 'Nuevo artículo', 78,39; SELECT newItemFk; END$$ DELIMITER ;