这是我的存储过程:
DELIMITER $$
CREATE PROCEDURE UserNameExists (IN pUserName VARCHAR(40), OUT rVal BIT)
LANGUAGE SQL
DETERMINISTIC
BEGIN
SET @recCount := (SELECT COUNT(*) FROM Users WHERE userName = pUserName);
IF @recCount > 0 THEN
SET rVal := 1;
ELSE
SET rVal := 0;
END IF;
END $$
DELIMITER ;
以下是我的称呼方式:
USE MyDatabase;
CALL UserNameExists('sampleUser', @outputParam);
Select @outputParam;
我得到一个空行,这里缺少什么?