data types in stored functions

From: "Cima" <ruel(dot)cima(at)facinf(dot)uho(dot)edu(dot)cu>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: data types in stored functions
Date: 2005-04-14 21:31:36
Message-ID: 016101c54139$5c453d30$f00110ac@doctorado1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

hi,

im working in postgresql 8 and i have a few sotred functions that need
restructuring. one of the functions needs to return a set of values that i
gathered(inner joined) from other tables. what im not to sure is how do i
return these values in a data type that will allow me to manipulte them in
php. the values im returning are of type integer,text and oid and charater.
this is more or less what i have:

create function my_function (a int) returns ?sometype? as $$
declare
some_var ?sometype?;
begin
select into some_var table1.col1,table1.col2, table2.col2 from
table1,table2
where table1.oid = table2.col1;
return some_var;
end;

language plpgsql;

what id like to know is what type of variable i could declare some_var as.

thanx.

P.D
in php im using pg_send_query and pg_get_result for this
stored function

Browse pgsql-novice by date

  From Date Subject
Next Message Lance Massey 2005-04-15 13:22:31 query syntax question
Previous Message Andrew Hammond 2005-04-14 19:51:03 Re: Problems on "copy" statement