on-internet
← Community

Retrieve data with a PL/pgSQL DO block

Stack Overflow ·

I have a PL/pgSQL code block to retrieve data from a selected row in a dropdown list in the user interface. Even though I'm selecting values and assigning the result in a loop, the block doesn't emit them outside, ending up not returning anything it collected: do $$ DECLARE w_idCandidato int; w_numeroDaProva int; BEGIN FOR v_idCandidato, v_numeroDaProva IN SELECT pg."idCandidato", pg."numeroDaProva" FROM public."tb_provasGeradasProCandidato" AS pg INNER JOIN public."tb_candidatos" cd ON "idCandidato" = cd.id INNER JOIN public."tb_processosSeletivos" pr ON "idProcesso" = pr.id WHERE cd.id = 27

Comments

Sign in or sign up to comment and upvote.

No comments yet.