MySQL Forums
Forum List  »  Connector/C++

How do I insert or query geometry value with X DevAPI?
Posted by: zhijun cao
Date: December 09, 2019 12:01AM

I have a table which holds a POINT geometry field, now I need to insert value using connector/C++ 8. With normal SQL it's easy:
INSERT INTO geom(center) VALUES (ST_GeomFromText('POINT(1,2)'));
Question is how do I do the same with connector/C++ 8? I have tried using TableInsert like this:
auto insert = db.getTable("detection").insert("center").values("ST_GeomFromText('POINT(1,2)')");

or

db.getTable("detection").insert("center").values("POINT(1,2)");

Neither way worked, with exception message "CDK Error: Cannot get geometry object from data you send to the GEOMETRY field".

I need your help and appreciate for that.

Options: ReplyQuote


Subject
Views
Written By
Posted
How do I insert or query geometry value with X DevAPI?
709
December 09, 2019 12:01AM


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.