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

17 lines
310 B
SQL

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