<div dir="ltr"><div>Hi,</div><div><br></div><div>have a problem here with editing an Oracle View:</div><div>QGIS 3.2.0-Bonn</div><div><br></div><div>The view is defined between a table with geodata and an alphanumeric:</div><div><br></div><div>CREATE OR REPLACE FORCE EDITIONABLE VIEW "C ## GIS". "VW_GEO_TEST" ("GID", "PNAME", "GEOM",</div><div>CONSTRAINT "VW_TEST_PK" PRIMARY KEY ("GID") DISABLE) AS</div><div>  (select b.gid, <a href="http://a.name">a.name</a> pname, a.geom</div><div>from GEO_QGIS_TEST a, geo_alpha_test b</div><div>where to_char (id) = b.gid);</div><div><br></div><div><br></div><div>To edit the view I defined an instead of triggers, for insert:</div><div><br></div><div>CREATE OR REPLACE EDITIONABLE TRIGGER "C ## GIS". "IOFT_INSERT_VW_GEO_TEST"</div><div>INSTEAD OF INSERT ON VW_GEO_TEST</div><div>FOR EACH ROW</div><div>DECLARE</div><div>BEGIN</div><div>insert into GEO_QGIS_TEST (id, name, geom) values ​​(to_number (: NEW.gid) ,: NEW.pname,: NEW.geom);</div><div>insert into geo_alpha_test (gid, at1) values ​​(: NEW.gid,: NEW.pname);</div><div>END ioft_insert_vw_all_abs;</div><div>/</div><div>ALTER TRIGGER "C ## GIS". "IOFT_INSERT_VW_GEO_TEST" ENABLE;</div><div><br></div><div><br></div><div>In the view I can easily insert objects via SQL, they appear correctly in both tables.</div><div><br></div><div>If I digitize a new object via QGIS and then save the changes, the data is also saved in both tables, but then QGIS issues an error message:</div><div><br></div><div>==================================</div><div>Konnte Änderungen am Layer VW_GEO_TEST nicht festschreiben</div><div><br></div><div>Fehler: FEHLER: Ein Objekt nicht hinzugefügt.</div><div>  </div><div>Datenanbieterfehler:</div><div>      Oracle-Fehler beim Attributhinzufügen: Oracle-Fehler: Konnte Objektkennung -4 nicht laden</div><div>    SQL: ORA-01445: Kann keine ROWID aus einer Join-View ohne Basistabelle (der View) auswählen oder erfassen</div><div>    Konnte Anweisung nicht ausführen</div><div>    Fehler: SELECT "GID" FROM "C##GIS"."VW_GEO_TEST" WHERE ROWID=:a</div><div><br></div><div>==================================<span style="white-space:pre">   </span></div><div><br></div><div><br></div><div>The error message is somewhat misleading here, the object was actually saved in the database, but then QGIS probably tries to read the object again via a ROWID and fails.</div><div>Unfortunately, this view has no ROWID:</div><div><br></div><div>> select a.rowid, a. * from VW_GEO_TEST a;</div><div>results</div><div>ORA-01445: Can not select or capture a ROWID from a join view without a base table (the view)</div><div>01445. 00000 - "can not select ROWID from, or sample, a join view without a key-preserved table"</div><div>* Cause:</div><div>* Action:</div><div>Error in line: 59 Column: 25</div><div><br></div><div>Is this so intentional or a mistake of QGIS? Mistake of me?</div><div>Looking at the sourcecode at src/providers/oracle/qgsoracleprovider.cpp it seems to that this is done intentionally but perhaps changeable. </div><div>My poor C++-Skills are not good enough to estimate the effort... Should i ask in qgis-developer?</div><div><br></div><div>I read a similar question on <a href="https://gis.stackexchange.com/questions/188339/edits-in-oracle-spatial-layers">https://gis.stackexchange.com/questions/188339/edits-in-oracle-spatial-layers</a> but not a solution for me.</div><div><br></div><div>Regards</div><div>Thomas</div></div>