0
我是MySQL存儲過程的新手。我寫了登錄驗證,但它不會工作。Mysql存儲過程問題
CREATE PROCEDURE `Login_validation`(
IN `Username` VARCHAR(50),
IN `password` VARCHAR(50))
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
IF EXISTS(SELECT * FROM user_details where [email protected]) THEN
BEGIN
IF EXISTS(SELECT * FROM user_details where [email protected] and [email protected]) THEN
BEGIN
SELECT 'SUCCESS' STATUSDISCRTIPTION, '100' STATUSCODE;
END;
ELSE
BEGIN
SELECT 'USERNAME AND PASSWORD NOT MATCHING' STATUSDISCRTIPTION, '101' STATUSCODE;
END;
END IF;
END;
ELSE
BEGIN
SELECT 'USERNAME NOT EXISTS' STATUSDISCRTIPTION , '101' STATUSCODE;
END;
END IF;
END
這是我的存儲過程,我選擇 'USERNAME NOT EXISTS' STATUSDISCRTIPTION, '101' 的StatusCode;只有這個輸出。如果循環不工作。
call Login_validation('Malathi','123456')
malathi name is there in table。問題是什麼?