salix/db/routines/vn/procedures/makeNewItem.sql

17 lines
306 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`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 ;