alter table storetw.fa_station add geom mdsys.sdo_geometry;

update storetw.fa_station set geom =
mdsys.sdo_geometry(2001,null,mdsys.sdo_point_type(LONGITUDE,LATITUDE,null),null,null);

commit;

insert into user_sdo_geom_metadata(table_name,column_name,diminfo,srid) values
('FA_STATION','GEOM',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('LONG',-180,0,0.0000005),
MDSYS.SDO_DIM_ELEMENT('LAT',0,90,0.0000005)),null);

commit;

CREATE INDEX storetw.FA_STN_LOC_IX ON storetw.fa_station (GEOM)
INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ('tablespace=storetindx LAYER_GTYPE=POINT');
