<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Jan Heckman <jan.heckman@gmail.com> <br>
<b>Lähetetty:</b> perjantai 5. helmikuuta 2021 16.10<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi><br>
<b>Kopio:</b> gdal <gdal-dev@lists.osgeo.org><br>
<b>Aihe:</b> Re: [gdal-dev] Fwd: ogr2ogr crash attempting to drop table in filegdb<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">However, ogrinfo does no better.<o:p></o:p></p>
<div>
<p class="MsoNormal">It refuses to rename a table (filegdb) and crashes on drop table.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Jan<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Feb 5, 2021 at 11:43 AM jratike80 <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">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" 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>
> <a href="mailto:gdal-dev@.osgeo">gdal-dev@.osgeo</a><br>
<br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" 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" 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" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>