[postgis-users] insert into a geometry field from 4gl

Fay Du fay.du at versaterm.com
Thu Feb 23 06:11:18 PST 2006


Thank you very, very much, Markus, it works!
Fay

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Markus Schaber
Sent: Thursday, February 23, 2006 3:20 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] insert into a geometry field from 4gl

Hi, Fay,

Fay Du wrote:

> INSERT INTO gps_log (uid, geom_pt) values ('test1',
> geomfromtext('POINT(1870391 320462)',-1));

This works fine.
> LET sql_stmt = "INSERT INTO gps_log  (uid,geom_pt) Values (?,?)"
>    PREPARE insert_gps_tb FROM sql_stmt
> 
> LET Uid="test"
> 
> LET gps_point = "geomfromtext('POINT(1870391 320462)',-1)"
> 
> EXECUTE insert_gps_tb USING uid, gps_point

This inserts the whole "geomfromtext('POINT(1870391 320462)',-1)" as
textual geometry representation.

Try this:

LET sql_stmt =
  "INSERT INTO gps_log  (uid,geom_pt) Values (?,geomFromText(?,-1))"
PREPARE insert_gps_tb FROM sql_stmt
LET Uid="test"
LET gps_point = "'POINT(1870391 320462)'"
EXECUTE insert_gps_tb USING uid, gps_point

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org
www.nosoftwarepatents.org
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list