[postgis-users] PL/PgSQL and PostGIS

CYW cyw at dls.net
Fri Jun 9 23:30:19 PDT 2006


Hi there,

I am trying a PL/PgSQL script below, and getting the following error:
	invalid input syntax for integer: "Point(111.000 999.22)"
	Context: PL/pgSQL function "testxy"  line # 12 at fecth

Any suggestions?
====================================================================
CREATE OR REPLACE FUNCTION testxy() RETURNS text AS $$
DECLARE
    thisrow point_table%ROWTYPE;
    rid integer DEFAULT 1;
    msg text;
    cur CURSOR(key integer) FOR SELECT AsText(geom) as geom
            FROM point_table WHERE guid=rid ORDER BY measure ASC;
BEGIN
    OPEN cur(rid);
    FETCH cur INTO thisrow ;
    CLOSE cur;
    RETURN thisrow.geom;
END;
$$ LANGUAGE plpgsql;

Thanks in advance
_cyw_





More information about the postgis-users mailing list