oracle - retrieve user defined datatype from table -


sql> -- case 1  sql>select nest_test.id.num nest_test; select nest_test.id.num nest_test        * error @ line 1: ora-00904: "nest_test"."id"."num": invalid identifier  sql> -- case 2  sql>select n.id.num nest_test n;      id.num ----------         12 

as, afaik, aliasing table giving simple name table or column. then, why i'm getting error in case 1, when i'm trying retrieve user defined object table ? happened, when aliased table.

the oracle documentation states table aliases required reference methods or attributes of objects avoid potential "inner capture" (a table column name clashing object attribute name). find out more.

the documentation states:

"you must qualify reference object attribute or method table alias rather table name if table name qualified schema name."

it doesn't why oracle enforce rule. there complexity in namespace implementation, caused retrofitting objects relational kernel.


"then, why query works select emp.sal emp"

because that's regular column on table. oracle have never enforced aliases on normal tables. starting break enormous amount of code has accrued on decades.

having use aliases 1 more penalty using object types define table columns. it's far being teh onerous aspect of clunky syntax goes oracle's ordbms implementation.

besides, there's cases in using objects rather realtional tables persist data rigyht solution, doesn't matter.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -