0

I'm creating the stored procedure in MySql as like below :

DELIMITER $$

Create procedure LoginVerify (p_UserName  varchar(50),p_Password varchar(50))
begin
select UserDetailID, First_Name, Last_Name, Email_Address, `User_Name` from user_details where `User_Name`=p_UserName and `Password`=p_Password
end

DELIMITER ;

After executing the above procedure I'm getting usually an exceptional message as like "sorry an unexpected error happened mysql" How to resolve that ? I had gone through same queries in stackoverflow, As they are saying the problem with delimeters. But I didn't get proper solution.

Srikanth Reddy
  • 447
  • 1
  • 8
  • 23
  • There end statement needs a delimiter ($$) and the select needs a terminator, but since there is only 1 statement you don't need begin and it's matching end or to set delimiters – P.Salmon Apr 09 '20 at 07:41
  • @P.Salmon Thanks. It got executed after removing the delimeters and begin and end. When to use delimeters then ?Thanks once again. – Srikanth Reddy Apr 09 '20 at 07:44
  • Don't store plain text passwords in the database. In a stored procedure, a salted hash with each row having a unique salt is probably one of the better options. – danblack Apr 09 '20 at 07:46
  • 'When to use delimeters then' - https://dev.mysql.com/doc/refman/8.0/en/stored-programs-defining.html – P.Salmon Apr 09 '20 at 07:53

0 Answers0