我有以下存储过程:-
-- PROCEDURE: public.master_todo(text, text)
-- DROP PROCEDURE IF EXISTS public.master_todo(text, text);
CREATE OR REPLACE PROCEDURE public.master_todo(
"actiontype" text,
"actionvalue" text)
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
IF(actiontype = 'getAllTodo') THEN
SELECT * FROM todo_list;
END IF;
END
$BODY$;
Run Code Online (Sandbox Code Playgroud)
我使用 PGAdmin 中的过程 -> 创建过程创建的。但是,在使用 EXEC 测试它时,出现错误:-
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 master_todo(text,text) line 4 at SQL statement
SQL state: 42601
Run Code Online (Sandbox Code Playgroud)
在阅读了有关此问题的其他一些答案后,我尝试了:- …
postgresql ×1