GustavoPaulus Posted May 4, 2015 Report Share Posted May 4, 2015 (edited) alguém já passou por esse erro 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 consultas(integer) line 6 at SQL statement ********** Error ********** ? a function é essa: CREATE OR REPLACE FUNCTION consultas (parametro int) RETURNS TEXT AS $BODY$ begin IF parametro = 1 THEN SELECT sum(b.ganhadores_sena) FROM base b; END IF; IF parametro = 2 THEN select numero from numeros n order by n.vezessorteado DESC; END IF; IF parametro = 3 THEN SELECT linha, numero as numero_mais_sorteado, vezessorteado from numerosorteadolinha; END IF; IF parametro = 4 THEN SELECT coluna, numero as numero_mais_sorteado, vezessorteado from numerosorteadocoluna; END IF; IF parametro = 5 THEN select numero as numeros_primeiroquadrante, vezessorteado from numeros n where n.numero in(1,2,3,4,5,11,12,13,14,15,21,22,23,24,25) ORDER BY n.vezessorteado DESC; END IF; END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100; SELECT CONSULTAS(1); Edited May 4, 2015 by GustavoPaulus Quote Link to comment Share on other sites More sharing options...
Question
GustavoPaulus
alguém já passou por esse erro ERROR: query has no destination for result data
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.