i want to create a stored procedure which will have 2 IN and 1 OUT parameter,
i want to pass username and password and want to get message [authenticate or not]
my stored procedure syntax look like-
DELIMITER $$
DROP PROCEDURE IF EXISTS `zero`.`user_varify`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `user_varify`(IN user_name VARCHAR(15),IN pass_word VARCHAR(15), OUT message VARCHAR(100))
BEGIN
DECLARE temp_password VARCHAR(15);
SELECT usr_pwd INTO temp_password from account_db where usr_name =user_name;
IF temp_password = pass_word THEN
SET message ='u r authenticated';
END IF;
IF temp_password != pass_word THEN
SET message='u r not authenticated';
END IF;
END$$
DELIMITER ;
to run this i wrote
CALL user_varify('amit','pathak',@message);
when i try to execute it ,i got a message at the bottom of query browser like- "query cancelled'
one thing is more when i add a line ----select message; in procedure after END IF, it is working properly, how it is happen-i want to know
1-right syntax is select @message but it is not working ,select message; it is working why
2-why i got the message like -"query cancelled"
3- i m using mysql query browser 1.2.12 here, i can execute one query at same time, for second i need to delete first, is there any solution of this..
I know i asked a lot, but really i spend my hours in this , when i failed then i posted my problem here.
please reply me
i got one thing more-> this is working fine in mysql text console....