Page 1 of 1

UNIDAC and SQL Server Geometry & Geography Data Types

Posted: Thu 12 May 2011 03:47
by b_yaghobi
Hi,

Can you add this futures in UNIDAC?

Best Regards
Yaghoobi

Posted: Fri 13 May 2011 07:57
by AndreyZ
Hello,

You can work with geometry and geography types in the following way:

Code: Select all

UniQuery.SQL.Text := 'insert into test_geo(id, geom, geog) values(:id, :geom, :geog)';
UniQuery.ParamByName('id').AsInteger := 1;
UniQuery.ParamByName('geom').AsMemo := 'LINESTRING(100 100, 20 180, 180 180)';
UniQuery.ParamByName('geog').AsMemo := 'LINESTRING(-122.360 47.656, -122.343 47.656)';
UniQuery.ExecSQL;
UniDAC provides server-independent interface for working with different databases. Geometry and geography are SQL Server specific types. It's better to use SDAC to work with these types, because SDAC has the corresponding functionality.