如何将 mysql 空间与准备好的语句一起使用
我有两种情况,使用以下语句:
INSERT INTO areas (name, polygon) VALUES (?, POLYGON(?,?,?,?,?,?))
将导致这样的错误:
Illegal non geometric ''58.03665463092348 14.974815566795314'' value found during parsing
这里的问题似乎是我的纬度和经度在 POLYGON() 中被引用为文本。
但是,根据WKT格式,我的语句中需要另一组():
INSERT INTO areas (name, polygon) VALUES (?, POLYGON((?,?,?,?,?,?)))
这只会导致以下错误:
Operand should contain 1 column(s)
我在这里不知所措,如何将准备好的语句与mysql空间信息一起使用?
I've got two scenarios, using the following statement:
INSERT INTO areas (name, polygon) VALUES (?, POLYGON(?,?,?,?,?,?))
Will result in errors like this:
Illegal non geometric ''58.03665463092348 14.974815566795314'' value found during parsing
What seems to be the problem here is that my lat and longitudes are quoted as texts within the POLYGON().
However,according to the WKT format I need another set of () in my statement:
INSERT INTO areas (name, polygon) VALUES (?, POLYGON((?,?,?,?,?,?)))
which will only result in the following error:
Operand should contain 1 column(s)
I'm at a loss here, how do I use prepared statements along with mysql spatial information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论