我需要有人帮我找出我的 sql 查询中的错误:
CREATE PROCEDURE confirm(IN bookingID INT, OUT status VARCHAR(40))
BEGIN
DECLARE numberOfPass INT;
DECLARE contactStatus VARCHAR(30);
SET numberOfPass = (SELECT count(*) FROM passenger WHERE passenger.Booking = bookingID);
SET contactStatus = (SELECT contact FROM booking WHERE booking.Id = bookingID);
IF numberOfPass <> (SELECT numberOfSeats FROM booking WHERE booking.Id = bookingID)) THEN SET status = "Passenger information missing";
ELSE IF ISNULL(contactStatus) THEN SET status ="Contact missing for booking";
ELSE SET status = "OK";
END IF;
END;
我收到以下错误消息:
ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在 ') THEN SET status = "Passenger information missing" 附近使用正确的语法;ELSE IF ISNULL(contactStatu' 在第 7 行
可能是什么错误?
提前致谢。