Yesterday I stumbled upon some strange behavior on a customers Oracle 10g instance. Some procedure I wrote gave me an invalid identifier exception but was running fine on my Oracle 11g instances.
The relevant query was something like the following:
select b.b.v_col_b
from tbla a
left join tblb b on a.pk_col_a = b.fk_a;
Pleas note the b.b.v_col_b part of the query. Changing from left join to inner join did finally raise a ORA-00904: "B"."B"."V_COL_B": invalid identifier exception, but:
- Isn't this a syntax error?
- Can somebody explain this behaviour?
A working demo can be found on sqlfiddle
Edit: Added the table definition:
create table tbla (
pk_col_a int primary key,
v_col_a varchar2(50));
create table tblb (
pk_col_b int primary key,
fk_a int,
v_col_b varchar2(50));
Edit2: As @LalitKumarB's mentioned this only seems to happen on Oracle 11g
select k.b.v_col_b from tbla a left join tblb b on a.pk_col_a = b.fk_a;Weird - Giorgi Nakeurib.v_col_b? - Arion12c? Because both the queries certainly throwsInvalid identifieron my 12c instance. Exact version is12.1.0.1. - Lalit Kumar B