[gdal-dev] How to add more than one column to a shapefile using ogrinfo

Jeff McKenna jmckenna at gatewaygeomatics.com
Sun May 1 04:51:22 PDT 2016

On 2016-05-01 5:20 AM, aborruso wrote:
> Hi,
> I have no problem to add a column to a shapefile with:
> ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer"
> But if I use, the second column is not added to the file.
> ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer(3), fieldY
> integer(3)"
> The shell gives me only
> INFO: Open of `myfile.shp'
>        using driver `ESRI Shapefile' successful.
> What's wrong in my syntax?

I think you have to use 2 ogrinfo statements.


Jeff McKenna
MapServer Consulting and Training Services

More information about the gdal-dev mailing list