[gdal-dev] SQLite dialect does not support ADD COLUMN

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] SQLite dialect does not support ADD COLUMN

jratike80

Hi,

 

I was awaiting that the following ogrinfo command woud add a new column but it didn’t

 

ogrinfo -dialect sqlite -sql "alter table fidtest add column foo" fidtest.shp

INFO: Open of `fidtest.shp'

      using driver `ESRI Shapefile' successful.

ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(alter table fidtest add foo):

  no such table: fidtest

 

I did succeed with OGR SQL dialect but I wonder why SQLite dialect fails.

 

-Jukka Rahkonen-


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: SQLite dialect does not support ADD COLUMN

Even Rouault-2
On mercredi 6 février 2019 16:02:44 CET Rahkonen Jukka (MML) wrote:

> Hi,
>
> I was awaiting that the following ogrinfo command woud add a new column but
> it didn't
>
> ogrinfo -dialect sqlite -sql "alter table fidtest add column foo"
> fidtest.shp INFO: Open of `fidtest.shp'
>       using driver `ESRI Shapefile' successful.
> ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(alter table fidtest add foo):
>   no such table: fidtest
>
> I did succeed with OGR SQL dialect but I wonder why SQLite dialect fails.

The SQLite dialect uses the SQLite virtual table mechanism internally. That
mechanism cannot modify table structure.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: SQLite dialect does not support ADD COLUMN

jratike80
Even Rouault-2 wrote

> On mercredi 6 février 2019 16:02:44 CET Rahkonen Jukka (MML) wrote:
>> Hi,
>>
>> I was awaiting that the following ogrinfo command woud add a new column
>> but
>> it didn't
>>
>> ogrinfo -dialect sqlite -sql "alter table fidtest add column foo"
>> fidtest.shp INFO: Open of `fidtest.shp'
>>       using driver `ESRI Shapefile' successful.
>> ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(alter table fidtest add
>> foo):
>>   no such table: fidtest
>>
>> I did succeed with OGR SQL dialect but I wonder why SQLite dialect fails.
>
> The SQLite dialect uses the SQLite virtual table mechanism internally.
> That
> mechanism cannot modify table structure.
>
> Even

Thanks Even,

I think I'll add these words of wisdom into documentation
https://www.gdal.org/ogr_sql_sqlite.html that does indeed list what is
supported and reader might understand that all the rest is not supported.

-Jukka-




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev