I try with QGIS to insert new features in a multi-table Oracle Spatial view that is updatable by adding an "instead of" trigger. The view is "key-preserved" and I don't have any problem when I insert a new feature directly in SQL.

But when I try to do this in QGIS (QGIS 2.18.24 as QGIS 3.2) I get this error :

Oracle error while adding features: Oracle error: Could not retrieve feature id -2

Despite this error, the feature is inserted in my database anyway. The problem is, if I save layer edits another time, my feature would be recorded 2 times.

Is this a limitation of the Oracle Spatial QGIS connector or I can do something to have a workaround solution?

  • I have never had an issue with Oracle Spatial Editing in QGIS - is there any restrictions on the user? like update/commit? – Mapperz Oct 12 '18 at 14:02
  • There is no restriction on the user who is the tables and view owner. I don't have any problems with Oracle Spatial tables either, only with Oracle Spatial views. I think the problem is there are no ROWID pseudocolumn in oracle views while there are in tables – Maxime Bescu Oct 12 '18 at 14:05
  • is it the same issues as this issues.qgis.org/issues/19259 ? – Mapperz Oct 12 '18 at 14:07
  • No, I think this issue is due to the date format only in QGIS 3.x – Maxime Bescu Oct 12 '18 at 14:10
  • A new small precision : this issue occurs only with multi-table view. With a view that is a mirror of an unique table there is no problem. – Maxime Bescu Oct 16 '18 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.