title: How to SELECT from object type column in Oracle 11g?
body: <p>Hy guys,
  I have following two Oracle objects:</p>
  
  <pre><code>CREATE OR REPLACE TYPE car AS OBJECT( 
  name VARCHAR( 80 ) 
  ) NOT FINAL;
  </code></pre>
  
  <p>And also, there is another object:</p>
  
  <pre><code>CREATE OR REPLACE TYPE truck UNDER car ( 
  doors NUMBER,
  seats NUMBER 
  );
  </code></pre>
  
  <p>There is also following table:</p>
  
  <pre><code>CREATE TABLE vehicles (
  id NUMBER NOT NULL,
  vehicle car,
  PRIMARY KEY (id)
  );
  </code></pre>
  
  <p>Here is some data:</p>
  
  <pre><code>INSERT INTO vehicles ( id, vehicle ) VALUES ( 1, truck( 'ford', 4, 4 ) );
  INSERT INTO vehicles ( id, vehicle ) VALUES ( 2, truck( 'toyota', 4, 5 ) );
  </code></pre>
  
  <p>Finally, my question is:
  <strong>How to select only number of doors and number of seats from vehicle table column?</strong></p>
  
  <p>I tried following but it does not work:</p>
  
  <pre><code>SELECT v.vehicle.doors AS doors AS seats FROM vehicles v;
  </code></pre>
  
  <p>I got following error:</p>
  
  <pre><code>ORA-00904: "V"."VEHICLE"."DOORS": invalid identifier
  </code></pre>
  
  <p>Only parameter that i can get without any error is one from car object.</p>
  
  <p>FYI, I am using Oracle 11g on CentOS 6.2</p>
  
  <p>Cheers,
  Bojan</p>