1

I wish to convert a layer that has no geometry field from Oracle to the Esri Shape format (DBF file only). I can do it manually from within QGis but I'd like to automate the process and use ogr2ogr (or a similar tool) instead, as I have dozens of such layers.

artwork21
  • 35,114
  • 8
  • 66
  • 134
Matti Siren
  • 63
  • 1
  • 5

1 Answers1

2

The following works for me. Here is the input table:

SQL> desc us_cities_n
Name                                     Null?    Type
---------------------------------------- -------- ----------------------------
ID                                                NUMBER
CITY                                              VARCHAR2(42 CHAR)
STATE_ABRV                                        VARCHAR2(2 CHAR)
POP90                                             NUMBER
RANK90                                            NUMBER

The following command makes a dbf file only:

$ ogr2ogr us_cities_n.dbf OCI:scott/tiger@orcl121:us_cities_n

(this is using GDAL/OGR 2.0.1)

Albert Godfrind
  • 2,888
  • 11
  • 11
  • Hi Albert, thanks for the solution! It was maybe just too simple so I didn't find it myself. :) I could have done this table by table from within QGIS but I'm so lazy I wanted to have an easier way. :) – Matti Siren Oct 28 '16 at 08:52
  • I was surprised too. I first tried it with csv output. Then decided to give it a try for dbf. And it worked :-) – Albert Godfrind Oct 28 '16 at 12:51