code_junkie

Why can't I reference a user defined type field when using nested queries?

Nov 12th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. CREATE OR REPLACE TYPE METRIC_IMPERIAL_DISTANCE AS OBJECT
  2. (
  3. METERS_FEET INTEGER,
  4. CENTIMETERS_INCHES INTEGER,
  5. FRACTION NUMBER
  6. )
  7.  
  8. SELECT t_id, get_distance_breakdown (h.height, h.unit_of_measure_id) height_breakdown
  9. FROM heights h
  10.  
  11. SELECT t_id, get_distance_breakdown (h.height, h.unit_of_measure_id).meters_feet height_meters_feet
  12. FROM heights h
  13.  
  14. SELECT t_id, height_breakdown.meters_feet
  15. FROM (SELECT t_id, get_distance_breakdown (h.height, h.unit_of_measure_id) height_breakdown
  16. FROM heights h);
  17.  
  18. SELECT v.t_id, v.height_breakdown.meters_feet
  19. FROM (SELECT t_id, get_distance_breakdown (h.height, h.unit_of_measure_id) height_breakdown
  20. FROM heights h) v;
Add Comment
Please, Sign In to add comment