<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>