Expand|Select|Wrap|Line Numbers
- 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.