ERROR: query has no destination for result data

后端 未结 2 707
再見小時候
再見小時候 2021-02-19 18:13
CREATE OR REPLACE FUNCTION _chkLogin(userid varchar, pwd varchar)
RETURNS BOOLEAN AS
$BODY$
DECLARE 
 passed BOOLEAN;
BEGIN
 SELECT  (_password = $2) FROM _vRegistration         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 19:07

    You do return passed but you never assign value to it.

    And select command within the function has to have place to put data to.

    So. Change your SQL to:

    SELECT  (_password = $2) INTO passed FROM _vRegistration WHERE _userid = $1;
    

    Also - since you're using names for variables (userid, pwd) use them:

    SELECT  (_password = pwd) INTO passed FROM _vRegistration WHERE _userid = userid;
    

提交回复
热议问题