Created
December 3, 2018 17:38
-
-
Save kllaudyo/02f72a675480f94b80b704bdd79dbac6 to your computer and use it in GitHub Desktop.
Iterando cursor com "FOR IN"
This file contains 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 PROCEDURE SAMPLE_CURSOR_IN AS | |
CURSOR UFS IS | |
SELECT ID_UF, NM_UF | |
FROM UNIDADES_FEDERACAO; | |
BEGIN | |
FOR J IN UFS | |
LOOP | |
CONTENT := '{"sigla":"'|| J.ID_UF ||'","nome":"'|| J.NM_UF ||'"}'; | |
END LOOP; | |
DBMS_OUTPUT.PUT_LINE(CONTENT); | |
END; --SAMPLE_CURSOR_IN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment