salix/db/changes/10032-webZone/00-myOrder_getAvailable.sql

23 lines
426 B
SQL

DROP procedure IF EXISTS `hedera`.`myOrder_getAvailable`;
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`myOrder_getAvailable`(vSelf INT)
BEGIN
/**
* Gets the available items list.
*
* @param vSelf The order id
* @table tmp.itemAvailable
*/
DECLARE isMine BOOL;
SELECT COUNT(*) INTO isMine
FROM myOrder
WHERE id = vSelf;
IF isMine THEN
CALL order_getAvailable(vSelf);
END IF;
END$$
DELIMITER ;