I export a polygon layer from Oracle to a FileGDB using ogr2ogr. I need to append one row to the data table, with '0' for numeric fields and 'No Elements' for the one string field. In ArcGIS, I run a model that appends a feature class with the one observation to the target feature class (the one exported from Oracle).
How can I perform the same function using ogr2ogr? Would I append the 'no_element' feature class to the target feature class, and if so, what is the ogr2ogr syntax? Both feature classes are in the same File GDB.
Or, is there something I could add to my ogr2ogr syntax when I export my data from Oracle; I've included my ogr2ogr for my Oracle export.
ogr2ogr -update -overwrite -nlt polygon -nln EO_DSMRE -a_srs EPSG:3089 -progress -f FileGDB G:/Office/Heritage/DataMngt/dpaml_app/KSNPC_Update/DSMRE.gdb OCI:biotics_dlink/XXXXXXXXXXXX@biotics5:EO_SHAPE -sql "select EO_SHAPE.SHAPE SHAPE, EO_SHAPE.EO_ID EO_ID, to_char( EO_SHAPE.EO_ID) EO_ID_STR, CASE WHEN (DSMRE_EO_VW.ELCODE LIKE 'P%' OR DSMRE_EO_VW.ELCODE LIKE 'N%') THEN 'Plant' WHEN (DSMRE_EO_VW.HIGHER_TAX_CODE LIKE 'IMGASF%' OR DSMRE_EO_VW.ELCODE LIKE 'IMBIV%' OR DSMRE_EO_VW.ELCODE LIKE 'AF%') THEN 'Aquatic Animal' WHEN DSMRE_EO_VW.ELCODE LIKE 'AMACC%' THEN 'Bat' WHEN DSMRE_EO_VW.ELCODE LIKE 'C%' THEN 'Community' ELSE 'Terrestrial Animal' END TAX_TYPE from EO_SHAPE, DSMRE_EO_VW where DSMRE_EO_VW.EO_ID = EO_SHAPE.EO_ID"
***Update
I have created a table in the Oracle data base with the fields 'SHAPE, EO_ID, TAX_TYPE'. The values for these fields are 'NULL, 0, "No Elements"'. I also created a view of the data that I have been exporting. Then I tried this:
select no_element_table.* from no_element_table union select shape_table.* from shape_table
That did not work, SQL Developer spits out ORA-22901: cannot compare VARRAY or LOB attributes of an object type.
So at this point, now that I have created the 'No_Elements' table, I just -update -append that to the target table.
ogr2ogr -update -append ......