Procedure parameters
BEGIN
IF EXISTS (SELECT *
FROM customer
WHERE usern = p_user AND password = p_pass)
SET p_output = 1;
ELSE
SET p_output = 0;
END;
MySQL gives me the error 1064, it's in the output. How i can do that set correctly? I have to give values to the p_output parameter? You can see how i did it in the image.
Thank you!
You are missing both the THEN and the END IF for your IF clause. Try this:
BEGIN
IF EXISTS (SELECT *
FROM customer
WHERE usern = p_user AND password = p_pass) THEN
SET p_output = 1;
ELSE
SET p_output = 0;
END IF;
END;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With