Functions return a select in a table, which data type I must use? (Brazilian User)

From: André Toscano <andre(dot)toscano(at)uol(dot)com(dot)br>
To: pgsql-sql(at)postgresql(dot)org
Subject: Functions return a select in a table, which data type I must use? (Brazilian User)
Date: 2004-11-21 23:07:48
Message-ID: 41A11FC4.4040909@uol.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello, friends.

If anybody can help, how can I do a FUNCTION return a result from a
SELECT in a table in PostgreSQL?
My Problem is the RETURN TYPE from a FUNCTION, I don´t know what I have
to use to return the data as a select result.

Example:
----------------

DROP FUNCTION ACADEMICO.teste(int4);

CREATE FUNCTION ACADEMICO.teste(int4)
RETURNS ?????
AS
'
select cod_aluno, nome, cpf from ACADEMICO.TB_alunos

'
LANGUAGE 'SQL';
----------------------------------

Thanks in Advance

André Toscano
(Brazilian user)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-11-22 01:03:33 Re: missing... at end of sql expression
Previous Message Tom Lane 2004-11-20 21:51:34 Re: JOIN not being calculated correctly