Hello to everyone. Im using MySQL 5.0. I am trying to create a simple stored procedure like,
This procedure is having exact syntax given in MySQL 5.0 Manual.
If i run this code in MYSQL Command Prompt, it shows errors like,
1.Invalid syntax, Check the MySQL Manual Corresponds to this.
2.Undeclared variable tcount.
What is wrong with the code?
Help me Soon.
Regards,
Vinoth.
Code:
CREATE PROCEDURE login_authenticate(IN uname varchar(50), IN pwd varchar(50), INOUT status) BEGIN DECLARE tcount INT DEFAULT 0; select count(*) into tcount from login where username=uname and password=pwd; if tcount > 0 then set status = 1 end if; if tcount = 0 then set status = 0 end if; END;
If i run this code in MYSQL Command Prompt, it shows errors like,
1.Invalid syntax, Check the MySQL Manual Corresponds to this.
2.Undeclared variable tcount.
What is wrong with the code?
Help me Soon.
Regards,
Vinoth.
Comment