Delete row from table which is linked to a view still not possible?
Delete row from table which is linked to a view still not possible?
I found this discussion: https://datatables.net/forums/discussion/26464/problem-deleting-a-row-from-table-which-is-linked-to-a-view
which is supposed to be solved, but I do encounter exactly the same issue. The only difference I can find is I am using a Postgres database connection.
SQLSTATE[55000]: Object not in prerequisite state: 7 ERROR: cannot delete from view "lookupview" DETAIL: Views that do not select from a single table or view are not automatically updatable. HINT: To enable deleting from the view, provide an INSTEAD OF DELETE trigger or an unconditional ON DELETE DO INSTEAD rule.
Answers
I found a solution for now by removing a join in my view. Somehow when deleting a row from the table, this also triggers the view to delete the row. If this view contains a join, this does not work (logically). So I found a work-around, but it would be good if Datatables has an option which only deletes the row from the table, without triggering the views.
Thanks for posting back - great to hear you found a workaround.
I will certainly look at the options for improving this area of Editor.
Regards,
Allan