pl/pgsql and returning rows - Mailing list pgsql-sql

From wade
Subject pl/pgsql and returning rows
Date
Msg-id 3.0.32.20010326115909.0194b810@mail.wavefire.com
Whole thread Raw
List pgsql-sql
Here is the senario...

I have a table defined as

create table details (
field1        <type>
field2        <type>
.
.
.
);

and a function:
create function get_details(int4) returns details as '
declare ret        details%ROWTYPE; site_rec    record; cntct       contacts%ROWTYPE;
begin select into site_rec  * sites_table where id = $1 limit 1; select into cntct * from contacts where id =
site_rec.contact;

-- and then i populate rows of ret. ret.name := cntct.name; ret.ip := site_rec.ip;
.
.
. return ret;
end;
' language 'plpgsql';

now the problem is when is when I do a: SELECT get_details(55);
all i get is a single oid-looking return value:get_details 
-------------136295592
(1 row)

How do i get at the actual information in the row?
Is this type of function even possible?
If not, is there a different manner in which i should approach this task?

Thanx in advance.-Wade


pgsql-sql by date:

Previous
From: selkovjr@mcs.anl.gov
Date:
Subject: Re: Help
Next
From: "Josh Berkus"
Date:
Subject: Function Vanished