Off the top of my head I believe you would do select (myfunc()).*<br>or (func()).attr1,...<br><br><div class="gmail_quote">On Wed, Jul 29, 2009 at 1:19 PM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
This is another slightly off topic, but maybe generally helpful inquiry.<br>
<br>
I have a plpgsql function the does some spatial queries and returns results using a type like:<br>
<br>
CREATE TYPE my_result AS<br>
(attr1 text,<br>
attr2 text,<br>
attr3 text,<br>
distance float,<br>
linkid int);<br>
<br>
<br>
in the function:<br>
<br>
DECLARE<br>
ret my_result;<br>
<br>
then set the values of the fields like:<br>
<br>
ret.attr1 := attr1;<br>
...<br>
<br>
and return the results like:<br>
<br>
return ret;<br>
<br>
<br>
later I do:<br>
<br>
select my_function(x,y);<br>
<br>
and get a result that looks like:<br>
<br>
("attr1","attr2","attr3",102.2,1234567)<br>
<br>
which all looks fine and dandy, except that I can not seem to access the individual fields. So for example if I want the value of my_result.attr1 how would I get that? Is there a better way to do this?<br>
<br>
Thanks,<br>
-Steve<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner<br>