Jump to content
Fórum Script Brasil
  • 0

ERROR: query has no destination for result data HINT: If you want to


GustavoPaulus

Question

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 by GustavoPaulus
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...