[OpenLayers-Users] PostGis Functions on Stored Procedure

David William Bitner bitner at gyttja.org
Mon Aug 4 11:18:53 EDT 2008


David,

This is a question for the PostGIS mailing list.  That being said, the issue
is in your use of single quotes,  You've got a lot going on, you need to
actually have a single quote show up in your 'Point(...' and you are trying
to just use single quotes when you are defining your function within single
quotes at the same time.

You might have better luck with something like this:

CREATE FUNCTION consul1ta_parametros(float, float) RETURNS void AS
$BODY$
select distance(
        the_geom,
        setsrid(makepoint($1,$2 ), 24877)
        )
    from recorrido where estado = 'V'
$BODY$
LANGUAGE SQL;

On Mon, Aug 4, 2008 at 10:12 AM, David Calle <davydky at gmail.com> wrote:

> Hi List,
>  I'm trying to use the Distance Function in a Declared Fuction but I have
> this error:
>
>
> CREATE FUNCTION consul1ta_parametros(float, float) RETURNS void AS '
> x_pos ALIAS FOR $1;
> y_pos ALIAS FOR $2;
> select distance(
>         the_geom,
>         PointFromText('POINT( '|| x_pos || ' ' || y_pos ||' )', 24877)
>         )
>     from recorrido where estado = 'V'' LANGUAGE SQL;
>
>
> ERROR:  syntax error at or near "POINT" en el carácter 157
> The question is...  Can I use the PostGIS functions here???
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>


-- 
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080804/6bb8462b/attachment.html


More information about the Users mailing list