问题
I want to store latitude and longitude in oracle db. Which data type its good to use it for both these fields. I really appreciate for your reply.
"latitude": 48.858844300000001,
"longitude": 2.2943506,
回答1:
Each column would be NUMBER(x+3,x)
where x is the maximum number of decimal places you would ever wish to store (48.858844300000001 is VERY precise).
回答2:
CREATE TABLE cola_markets ( mkt_id NUMBER PRIMARY KEY, name VARCHAR2(32), shape SDO_GEOMETRY);
And for point
CREATE TYPE sdo_point_type AS OBJECT ( X NUMBER, Y NUMBER, Z NUMBER); CREATE TYPE sdo_elem_info_array AS VARRAY (1048576) of NUMBER; CREATE TYPE sdo_ordinate_array AS VARRAY (1048576) of NUMBER;
For inserting and select queries please read Oracle document here
来源:https://stackoverflow.com/questions/38374775/data-type-for-storing-latitude-and-longitude-in-oracle-database