<div dir="ltr">David,<br><br>This is a question for the PostGIS mailing list.&nbsp; That being said, the issue is in your use of single quotes,&nbsp; You&#39;ve got a lot going on, you need to actually have a single quote show up in your &#39;Point(...&#39; and you are trying to just use single quotes when you are defining your function within single quotes at the same time.<br>
<br>You might have better luck with something like this:<br><br>CREATE FUNCTION consul1ta_parametros(float, float) RETURNS void AS <br>$BODY$<br>select distance(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; the_geom,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setsrid(makepoint($1,$2 ), 24877) <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ) <br>&nbsp;&nbsp;&nbsp; from recorrido where estado = &#39;V&#39;<br>$BODY$<br>LANGUAGE SQL;<br><br><div class="gmail_quote">On Mon, Aug 4, 2008 at 10:12 AM, David Calle <span dir="ltr">&lt;<a href="mailto:davydky@gmail.com">davydky@gmail.com</a>&gt;</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;"><div dir="ltr">Hi List, <br>&nbsp;I&#39;m trying to use the Distance Function in a Declared Fuction but I have this error:<br>
<br><br>CREATE FUNCTION consul1ta_parametros(float, float) RETURNS void AS &#39;<br>x_pos ALIAS FOR $1;<br>
y_pos ALIAS FOR $2;<br>select distance(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; the_geom,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PointFromText(&#39;POINT( &#39;|| x_pos || &#39; &#39; || y_pos ||&#39; )&#39;, 24877) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ) <br>&nbsp;&nbsp;&nbsp; from recorrido where estado = &#39;V&#39;&#39; LANGUAGE SQL;<br>

<br><br>ERROR:&nbsp; syntax error at or near &quot;POINT&quot; en el carácter 157<br>The question is...&nbsp; Can I use the PostGIS functions here???<br></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner<br>
</div>