This question found its way into my In Box yesterday: I have a table with an object type column. I want to way to get the value of an attribute of that object type in my query. But Oracle keeps telling me "ORA-00904: invalid identifier". What am I doing wrong? Almost certainly what you are doing wrong is forgetting to use a table alias. Yeah, it's that simple. Don't forget the table alias. Let's take a look. I create an object type, use that object type as a column in a table, and insert a couple of rows: CREATE TYPE food_t AS OBJECT ( NAME VARCHAR2 (100) , food_group VARCHAR2 (100) , grown_in VARCHAR2 (100) ) / CREATE TABLE food_table (id number primary key, my_food food_t) / BEGIN INSERT INTO food_table VALUES (1, NEW food_t ('Mutter Paneer', 'Curry', 'India')); INSERT INTO food_table VALUES (2, NEW food_t ('Cantaloupe', 'Fruit', 'Backyard')); COMMIT; END; ...
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?