MySQL监听数据库存储过程出现异常

DELIMITER $$

DROP PROCEDURE IF EXISTS `proc_ordertourist_cancel`$$

CREATE PROCEDURE proc_ordertourist_cancel(IN p_userid INT, IN p_touristorderid INT)
SQL SECURITY INVOKER
body:
BEGIN
DECLARE c_touristorder_source INT;

-- 监听数据库存储过程出现异常
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
SELECT
- 100;
END;

-- 结束监听

START TRANSACTION;
IF EXISTS (SELECT
*
FROM qr_touristorder qt
WHERE qt.touristorder_id = p_touristorderid AND (qt.touristorder_state > 0 OR

qt.touristorder_state = - 1)) THEN
ROLLBACK;
SELECT
- 1;
LEAVE body;
END IF;
SELECT
1;
COMMIT;
END$$

DELIMITER ;

上一篇:考试宝典-真题园安卓AppV2.1.0新版发布啦,全新界面,全新体验,全面适配Android 5.0&6.0系统!


下一篇:转载:c# string.Format