Ich habe eine gespeicherte Prozedur:PostgreSQL gespeicherte Prozedur Fehler
CREATE OR REPLACE FUNCTION postalcode_lookup(ccode character(6))
RETURNS SETOF postalcode AS $BODY$
BEGIN
WITH RECURSIVE tblParent AS
(
SELECT *
FROM postalcode
WHERE postalcode.code = ccode
UNION ALL
SELECT postalcode.*
FROM postalcode
JOIN tblParent ON postalcode.code = tblParent.parent
)
SELECT * FROM tblParent;
END;$BODY$ LANGUAGE plpgsql;
Compile erfolgreich, aber wenn ich laufen
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 postalcode_lookup(character) line 3 at SQL statement
Bitte helfen Sie mir zu beheben. Danke vielmals.
[RETURN NEXT und RETURN QUERY] (https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#AEN62624) – Abelisto