This PL/SQL package converts a query with a sdo_geometry into an ESRI shape file and a shape file into a Oracle table. It can also convert a Oracle table into a dBase file and vice versa.
Sample 1 - create a shape file (alk.shp, alk.shx, alk.dbf) of type 5 (=Polygon) from table MYTABLE with sdo-column="geo" and SDO_GTYPE=3003:
select zvk_shape.write_shp('DATA_PUMP_DIR','alk',
'select t.C01 "NAME",
t.C20 "FLST",
t.GEO
from MYTABLE t
where t.C02 = ''ALK''
order by...