0

这是我的存储过程:

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;

结果我得到一个空行,这里缺少什么?

4

0 回答 0