I have an Oracle spatial layer that is built on top of a multi table view. When I make a new feature in QGIS, I get an error when I attempt to the save the edit. When I look in the database and refresh the QGIS view, the new features are present, so the error is being thrown even though the operation is successful. The errors says could not retrieve feature id -2 and has a sql statement where it looks like QGIS is quering by rowid. I was wondering if anyone elese has seen something similar to this or if it is possible to have qgis not use Oracle rowid as a check.
Can you show the SQL definition of the view?
Generally only simple views are updatable in Oracle (and other RDBMSs): views that select columns and rows in a single table. Anything else: aggregates, joins, subqueries ... are not.
You can make them updatable by adding an INSTEAD OF trigger to the view where you write the logic to apply to properly update the underlying tables.
The other issue is with ROWIDs. Those are physical pointers to table rows. A join view does not have any. So yes, you need to tell QGIS to find another way to identify rows in the view. However that is only possible if the view is "key-preserved" i.e if each row has a unique key that exists in both tables, i.e the join is a simple inner join.