mysql创建存储过程

DROP PROCEDURE IF EXISTS sp_getReportReCheckTodoMsg;

DELIMITER //

CREATE DEFINER=root@localhost PROCEDURE sp_getReportReCheckTodoMsg(IN taskId VARCHAR(50), IN projectId VARCHAR(50)) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA SQL SECURITY DEFINER COMMENT '' BEGIN
SELECT "报告审核" AS title, CONCAT('【',t2.project_name,'】质量负责人报告审批通过。') AS msgbody, CONCAT_WS(',',t.projectid,t.apply_name,t2.manager_id,(
SELECT yhid
FROM t_rms_groups_user
WHERE yhzid=49)) AS receivers
FROM t_project_report t
INNER JOIN t_project_apply t2 ON t2.project_id=t.projectid
WHERE t.projectid=projectId;
END
//
DELIMITER ;

注意:DELIMITER ;//中间的空格

posted on 2017-12-11 15:56  wolf12  阅读(171)  评论(0编辑  收藏  举报