Re: Problem with collections, casting and ORA 904

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 4 Oct 2001 04:21:15 -0700
Message-ID: <9phgnb024o6_at_drn.newsguy.com>


[Quoted] In article <9pfmfl$733$1_at_sun-cc204.lut.ac.uk>, "Andrew says...
>
>I have the following types defined:
>
>TYPE t_stfr_rec AS OBJECT
> (
> stfa_id NUMBER
> ,datestamp DATE
> ,withdrawal_qty NUMBER
> ,injection_qty NUMBER
> ,period_start DATE
> ,period_end DATE
> );
>
>TYPE t_stfr_table AS TABLE OF t_stfr_rec;
>
>and a function defined as:
>
>FUNCTION get_stfr
>RETURN t_stfr_table;
>
>I thought that I would be able to access this type using
>
>SELECT * FROM table(get_stfr AS t_stfr_table))
>

missing CAST:

ops$tkyte_at_ORA8I.WORLD> select *
  2 from TABLE( cast( my_func as myTableType ) )   3 /

>but I get an ORA 904 referring to get_stfr.
>
>What am I doing wrong?
>
>Andy
>--
>Opinions are mine and do not necessarily reflect those of Advantica
>Technologies Ltd
>
>

--
Thomas Kyte (tkyte_at_us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Oct 04 2001 - 13:21:15 CEST

Original text of this message