I found out that Oracle Database 10g and 11g handle the following PL / SQL block differently (for convenience I use the scott schema):
DECLARE v_ename bonus.ename%TYPE; BEGIN SELECT b.ename INTO v_ename FROM bonus b JOIN emp e ON b.ename = e.ename JOIN dept d ON d.deptno = e.deptno WHERE b.ename = 'Scott' FOR UPDATE OF b.ename; END; /
While in 10g (10.2) this code succeeds (the NO_DATA_FOUND exception is well eliminated, but this is expected), in 11g (11.2) it throws a "column ambiguously defined" exception. And it is definitely not expected. It seems that it does not take into account the alias of the table, because I found that when I change the column in FOR UPDATE format e.empno (also does not work) to e.mgr (which is unique), it starts to work. So is this a bug in 11g? Any thoughts?
source share