salix/services/db/install/changes/1.0.3/02-messageSend.sql

18 lines
448 B
SQL

USE `vn`;
DROP function IF EXISTS `messageSend`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` FUNCTION `messageSend`(vRecipient VARCHAR(255) CHARSET utf8, vMessage TEXT CHARSET utf8) RETURNS int(11)
BEGIN
DECLARE result INT;
DECLARE vSenderFk INT;
SELECT id INTO vSenderFk
FROM account.user WHERE `name` = account.userGetName();
RETURN (SELECT messageSendWithUser(vSenderFk, vRecipient, vMessage));
END$$
DELIMITER ;