【发布时间】:2015-11-01 00:36:55
【问题描述】:
我是 postgre 的新手,但遇到了问题。 我想完善程序:
CREATE OR REPLACE FUNCTION autenticarusuario()
RETURNS users AS
$BODY$`
DECLARE
login text;
senha text;
BEGIN
SELECT * FROM users WHERE login_user = login
AND pass_user = senha;
END;
$BODY$
LANGUAGE plpgsql IMMUTABLE
COST 100;
ALTER FUNCTION autenticarusuario()
OWNER TO postgres;
但我总是收到消息:
ERROR: query has no destination for result data
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT: PL/pgSQL function autenticarusuario() line 6 at SQL statement
********** Error **********
ERROR: query has no destination for result data
SQL state: 42601
Hint: If you want to discard the results of a SELECT, use PERFORM instead.
Context: PL/pgSQL function autenticarusuario() line 6 at SQL statement
【问题讨论】:
标签: sql function authentication stored-procedures