Hi, I think I would rename the columns and drop tables with other tools then, or create the database right from the beginning. If you write fgb you probably has some ESRI programs available. I guess you have already considered to switch to GeoPackage but you have some reason for not doing so.
-Jukka Rahkonen- Lähettäjä: Jan Heckman <[email protected]> Lähetetty: perjantai 5. helmikuuta 2021 16.10 Vastaanottaja: Rahkonen Jukka (MML) <[email protected]> Kopio: gdal <[email protected]> Aihe: Re: [gdal-dev] Fwd: ogr2ogr crash attempting to drop table in filegdb However, ogrinfo does no better. It refuses to rename a table (filegdb) and crashes on drop table. Jan On Fri, Feb 5, 2021 at 11:43 AM jratike80 <[email protected]<mailto:[email protected]>> wrote: Hi, SQL in ogr2ogr is only for SELECT. For any other purpose use ogrinfo. An example: ogrinfo -sql "alter table point_p rename column test to foo" point.gpkg -dialect sqlite -Jukka Rahkonen- janhec wrote > Dear list, > > About the filegdb driver > Attempting: > ogr2ogr -f FILEGDB test.gdb bag2101.gdb -update -sql "drop table > standplaats" > crashed ogr2ogr (obtained from gisinternals.com<http://gisinternals.com>, > gdal-302-1928-x64-core.msi > etc) with a heap corruption. (VS: Unhandled exception at > 0x00007FFE1C6EF099 > (ntdll.dll) in ogr2ogr.exe: 0xC0000374: A heap has been corrupted > (parameters: 0x00007FFE1C7587F0).) > The table does get dropped. > > The table was inserted from a shapefile using: > ogr2ogr --config shape_encoding "UTF-8" --config FGDB_BULK_LOAD YES > -append > -f "filegdb" bag2101.gdb sta.shp -nln standplaats -sql "select identifica > as identificatie,hfdadresid as hoofdadresid,* from sta", and displays > properly in Qgis. > > So the filegdb driver appears to be properly installed. > > Also, I could not get column renaming to work. Using dialects filegdb and > OGR SQL, > ogr2ogr -f FILEGDB test.gdb test.gdb -update -sql "alter table vbo_actueel > rename column oppervlakt to oppervlakte" -dialect "FILEGDB" > gives ERROR 1: Failed at executing 'alter table vbo_actueel rename column > oppervlakt to oppervlakte' (An invalid SQL statement was used.); > using -dialect SQLITE, I get > ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(Alter table vbo_actueel > rename > column oppervlakt to oppervlakte): no such table: vbo_actueel > whereas ogrinfo clearly states the table exists. > > I am trying to clear my arcgis ties preferring Qgis and for reasons of > cost, but sometimes I do need to provide data in filegdb format. > > Thanks in advance for any advice, > Jan > > PS. I do not add the shapefile for reference, since that version of this > mail got "rejected by the owner" for being about 1500 bytes in size. > > _______________________________________________ > gdal-dev mailing list > [email protected]<mailto:[email protected]> > https://lists.osgeo.org/mailman/listinfo/gdal-dev -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html _______________________________________________ gdal-dev mailing list [email protected]<mailto:[email protected]> https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
