2

I have developed a cadastral application with QGIS 2.18.13. The cadastral plots are stored as polygons (WKB type "Polygons") in a Spatialite database, a number of attributes is included.

This worked well for a while but now I am facing a commit error when I try to save changes?

Nothing is stored in the database. The error message is as follows (translated from Dutch):

Commit of changes has failed for layer Erf


Errors: ERROR: 1 item not added.

 Provider errors:
  SQLite error: unknown cause
SQL: INSERT INTO "Erf"("geometrie","pkuid","Perceelnummer","Naam","Voornamen","Beroepen",
"Woonplaatsen","Artikel kadastrale legger","Soort van de eigendommen",
"Nummer der gebouwde eigendommen","Inhoud perceel","Bijeengetrokken soort van bebouwing",
"Voorlopige klassering","Polder- of Dijklasten",
"Tarief ongeb Klasse 1","Tarief ongeb Klasse 2",
"Tarief ongeb Klasse 3","Tarief ongeb Klasse 4","Tarief ongeb Klasse 5",
"Kad ink geb eigendommen","Kad ink bijeengetrokken","Aftrek wegens polder- of dijklasten",
"Belastbaar inkomen gebouwed","Belastbaar inkomen gebouwd","Verwijzing SAT") 
VALUES (GeomFromWKB(?, 3857),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

Other layers, also writing to the same database, operate normally.

Does anyone have an idea where to find a solution?

Martin Hügi
  • 3,612
  • 2
  • 22
  • 51
  • SOLVED: it appeared that database table definitions are stored in QGIS layer definitions. As soon as table definitions are changed in the database (e.g. with DB Browser for SQLite, the database and layer are inconstent and errors follow. Not so elegant. Have not find tools in QGIS to validate and repair consistency. – Henk Schaap Oct 25 '17 at 12:43
  • Can you explicit how did you solve it ? I'm currently facing the same problem. – Gingerbread Nov 23 '17 at 15:00
  • Hi Gingerbread, Unfortunately the workaround is not so easy and goes as follows: within QGIS, create a new spatialite layer; create attributes according to the new datatabase definition; within QGIS copy the content of the old layer to the new layer; if everything went well, the new layer is editable and you can commit changes. Delete the old layer. Success! – Henk Schaap Nov 25 '17 at 20:02

0 Answers0