ERROR: query has no destination for result data

后端 未结 2 703
再見小時候
再見小時候 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 18:40

    Notes about assign value

    (see this other question for assign value to variable at declaration section)

    The language PLpgSQL syntax have many ways to say:

     Y := f(X);
    

    The EXECUTE clause is only for "dynamic execution" (less performance),

     EXECUTE 'f(X)' INTO Y;     
    

    Use Y := f(X); or SELECT for execute static declarations,

     SELECT f(X) INTO Y;
    

    Use PERFORM statment when discard the results or to work with void returns:

     PERFORM f(X);     
    

提交回复
热议问题