Created
August 23, 2016 17:29
-
-
Save sebawebber/c12d2bde840900623336019f0e427e3c to your computer and use it in GitHub Desktop.
exemplo de retorno de multiplas linhas em PL/PGSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION fnc_intervalo() | |
| RETURNS SETOF interval AS | |
| $$ | |
| DECLARE | |
| BEGIN | |
| RETURN NEXT 1; | |
| RETURN NEXT 2; | |
| END; | |
| $$ LANGUAGE 'plpgsql'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sebastian=# select fnc_test(); | |
| fnc_test | |
| ---------- | |
| 1 | |
| 2 | |
| (2 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment