I created a GPKG layer whose name is Grid 1. In database, I wrote a trigger,because when attribute table of layer is changed, another table value should be changed also -They have common id's.

However, when I try to edit the attribute table, I can not edit it. Here is my update trigger code:

self.execSql("CREATE TRIGGER 'ibound_trigger1' AFTER UPDATE OF ibound ON 'Grid1' BEGIN UPDATE 'Yas_Veri' SET ibound = NEW.ibound WHERE cell_id = NEW.cell_id; END;")

Grid1: GPKG layer on canvas (triggers Yas_Veri table)

Yas_Veri: Table in my database (triggered from Grid1)

ibound : column name (common for both table)

1 Answer 1


It is because of primary key. The table has to have primary key.

  • Don't forget to accept your own answer! You earned it! Feb 4, 2020 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.