pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
functions problems
2+ messages / 2 participants
[nested] [flat]

* functions problems
@ 2003-04-21 20:48  Mario Alberto Soto Cordones <mario_soto@compuall.cl>
  0 siblings, 1 reply; 2+ messages in thread

From: Mario Alberto Soto Cordones @ 2003-04-21 20:48 UTC (permalink / raw)
  To: pgsql-sql

Hi.

i have a functions what return one column and work good but when create a
new function to return 2 column´s it´s say error...

any idea

thank
Mario




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: functions problems
@ 2003-04-21 21:24  Randall Lucas <rlucas@tercent.net>
  parent: Mario Alberto Soto Cordones <mario_soto@compuall.cl>
  0 siblings, 0 replies; 2+ messages in thread

From: Randall Lucas @ 2003-04-21 21:24 UTC (permalink / raw)
  To: Mario Alberto Soto Cordones <mario_soto@compuall.cl>; +Cc: pgsql-sql


Mario,

Either have it return a "record" type and use an explicit column 
definition list, or else declare a table with the columns as you like 
and return a type of a row from that table.

The first one is easy:

create or replace function test__show_record_return(int) returns record 
as '
  select $1 +1, $1 +2;
' language sql;

select * from test__show_record_return(5) as (plusone int, plustwo int);

Best,

Randall


On Monday, April 21, 2003, at 04:48 PM, Mario Alberto Soto Cordones 
wrote:

> Hi.
>
> i have a functions what return one column and work good but when 
> create a
> new function to return 2 column´s it´s say error...
>
> any idea
>
> thank
> Mario
>
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-04-21 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-21 20:48 functions problems Mario Alberto Soto Cordones <mario_soto@compuall.cl>
2003-04-21 21:24 ` Randall Lucas <rlucas@tercent.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox