SQL window: not all columns can be updated when selecting from more tables

Claus Pedersen

Member³
In an SQL window I enter the following select on scott/tiger:
SQL:
SELECT dept.dname,
       emp.comm,
       emp.ename
FROM   dept,
       emp
WHERE  emp.deptno = dept.deptno
FOR UPDATE OF emp.comm
and I want to update comm. I press the padlock to edit data. The columns comm and ename can not be updated, whereas the column dname can.
If I switch the tables dept and emp in the from clause, the situation is reversed. Now data from emp can be updated whereas data from dept can not. But the updated data can not be posted, I get the error ORA-01410: invalid ROWID. You have to include emp.rowid in the select in order to make this work. This is a bummer, if you have updated many rows, because the only way to continue is to execute the query again and then all your changes are lost.

Please fix this (or at least somehow indicate which columns can be updated).
 
From the original post:
You have to include emp.rowid in the select in order to make this work

Yes, and this works. But my point is that PLD does not warn me that the update is not possible until I get the ORA error and all my changes are lost. Why does the order of table names in the from clause matter? I am sure there is a good technical explanation, but I can not see the reason for this.
 
Back
Top