MySQL Forums
Forum List  »  GIS

GeomFromText error
Posted by: Carin Pretorius
Date: February 19, 2017 11:48PM

I have a table with a Decimal degrees (-22.541100,30.719333) field. I altered the table and added a spatial data column (POINT) to the table. I am trying to update the POINT field with the point value of the Decimal degrees field but cannot get it to work.

I use MySQl 5.7

This is my sql:
SELECT @loc:= REPLACE(coordinates, ',', ' ') FROM interventions where id = 20;
UPDATE interventions SET location = ST_GeomFromText('POINT('@loc')') where id = 20;

I keep on getting an error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@loc')') where id = 20' at line 1

Can you see what I am doing wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
GeomFromText error
2011
February 19, 2017 11:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.