sql - Double/Random alias name in select clause on Oracle 11g does not throw invalid identifier exception -


yesterday stumbled upon strange behavior on customers oracle 10g instance. procedure wrote gave me invalid identifier exception running fine on oracle 11g instances.

the relevant query following:

select b.b.v_col_b  tbla left join tblb b on a.pk_col_a = b.fk_a; 

pleas note b.b.v_col_b part of query. changing left join inner join did raise ora-00904: "b"."b"."v_col_b": invalid identifier exception, but:

  1. isn't syntax error?
  2. can explain behaviour?

a working demo can found on sqlfiddle

edit: added 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: @lalitkumarb's mentioned seems happen on oracle 11g

congratulations, have found bug :)

in particular case can write whatever want when selecting of tblb columns:

select helloworld.b.v_col_b, mghjfghj.b.fk_a, asdasdas.b.pk_col_b tbla left join tblb b on a.pk_col_a = b.fk_a; 

you can right join:

select helloworld.b.v_col_b, mghjfghj.b.fk_a, asdasdas.b.pk_col_b tblb b right join tbla on a.pk_col_a = b.fk_a; 

it won't work oracle join syntax ( (+) notation ) though.

it not expected behaviour and, lalit noted in comments, fixed in 12c. can file bug request wit oracle support if want. maybe there patch it.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -