<div dir="ltr">However, ogrinfo does no better.<div>It refuses to rename a table (filegdb) and crashes on drop table.</div><div>Jan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 5, 2021 at 11:43 AM jratike80 <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
SQL in ogr2ogr is only for SELECT. For any other purpose use ogrinfo.<br>
An example:<br>
<br>
ogrinfo -sql "alter table point_p rename column test to foo" point.gpkg<br>
-dialect sqlite<br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
janhec wrote<br>
> Dear list,<br>
> <br>
> About the filegdb driver<br>
> Attempting:<br>
> ogr2ogr -f FILEGDB test.gdb bag2101.gdb -update -sql "drop table<br>
> standplaats"<br>
> crashed ogr2ogr (obtained from <a href="http://gisinternals.com" rel="noreferrer" target="_blank">gisinternals.com</a>,<br>
> gdal-302-1928-x64-core.msi<br>
> etc) with a heap corruption. (VS: Unhandled exception at<br>
> 0x00007FFE1C6EF099<br>
> (ntdll.dll) in ogr2ogr.exe: 0xC0000374: A heap has been corrupted<br>
> (parameters: 0x00007FFE1C7587F0).)<br>
> The table does get dropped.<br>
> <br>
> The table was inserted from a shapefile using:<br>
> ogr2ogr --config shape_encoding "UTF-8" --config FGDB_BULK_LOAD YES<br>
> -append<br>
> -f "filegdb" bag2101.gdb sta.shp -nln standplaats -sql "select identifica<br>
> as identificatie,hfdadresid as hoofdadresid,* from sta", and displays<br>
> properly in Qgis.<br>
> <br>
> So the filegdb driver appears to be properly installed.<br>
> <br>
> Also, I could not get column renaming to work. Using dialects filegdb and<br>
> OGR SQL,<br>
> ogr2ogr -f FILEGDB test.gdb test.gdb -update -sql "alter table vbo_actueel<br>
> rename column oppervlakt to oppervlakte" -dialect "FILEGDB"<br>
> gives ERROR 1: Failed at executing 'alter table vbo_actueel rename column<br>
> oppervlakt to oppervlakte' (An invalid SQL statement was used.);<br>
> using -dialect SQLITE, I get<br>
> ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(Alter table vbo_actueel<br>
> rename<br>
> column oppervlakt to oppervlakte): no such table: vbo_actueel<br>
> whereas ogrinfo clearly states the table exists.<br>
> <br>
> I am trying to clear my arcgis ties preferring Qgis and for reasons of<br>
> cost, but sometimes I do need to provide data in filegdb format.<br>
> <br>
> Thanks in advance for any advice,<br>
> Jan<br>
> <br>
> PS. I do not add the shapefile for reference, since that version of this<br>
> mail got "rejected by the owner" for being about 1500 bytes in size.<br>
> <br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
<br>
> gdal-dev@.osgeo<br>
<br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>