Unix Technical Forum

data types in stored functions

This is a discussion on data types in stored functions within the pgsql Novice forums, part of the PostgreSQL category; --> hi, im working in postgresql 8 and i have a few sotred functions that need restructuring. one of the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:42 PM
Cima
 
Posts: n/a
Default data types in stored functions

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


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com