我试图使用这个过程:
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_login`(
IN in_Email VARCHAR(60),
IN in_Pass VARCHAR(45)
)
BEGIN
DECLARE d_UserType VARCHAR(45);
SET d_UserType := db.get_usertype( (SELECT ID FROM User WHERE Email = in_Email ) );
IF (d_UserType = '1') THEN
SELECT * FROM User inner join tableA on tableA.ID = User.tableA_ID;
ELSEIF (d_UserType = '2') THEN
SELECT * FROM User inner join tableB on tableB.ID = User.tableB_ID;
ELSEIF (d_UserType = '3') THEN
SELECT * FROM User inner join tableC on tableC.ID = User.tableC_ID;
END IF;
END但我得到以下错误:错误1305(42000):功能db.get_usertype不存在。
该
CALL db.get_usertype( (SELECT ID FROM User WHERE Email = 'example@') );当我单独测试时工作正常。任何人都知道它为什么起作用?
我试过了:
SET d_UserType := CALL db.get_usertype( (SELECT ID FROM User WHERE Email = in_Email ) );
SET d_UserType := EXEC db.get_usertype( (SELECT ID FROM User WHERE Email = in_Email ) );
SET d_UserType := EXECUTE db.get_usertype( (SELECT ID FROM User WHERE Email = in_Email ) );没有运气..
Thx的所有帮助!
如果觉得《mysql c 调用存储过程返回值_Mysql:使用返回值调用存储过程》对你有帮助,请点赞、收藏,并留下你的观点哦!