Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Pl/Sql Casting Objects: error using the TABLE operator

Re: Pl/Sql Casting Objects: error using the TABLE operator

From: Barbara Boehmer <baboehme_at_hotmail.com>
Date: 4 Jul 2005 19:55:56 -0700
Message-ID: <1120532155.998538.4080@g14g2000cwa.googlegroups.com>


scott_at_ORA92> declare
  2 vtbl my_type_table_object;
  3 begin

  4  	SELECT CAST(MULTISET(select col1, col2
  5  			     from my_table
  6  			    )
  7  		    AS my_type_table_object
  8  		   )
  9  	INTO VTBL
 10  	from dual
 11  	;

 12
 13
 14  	for vrow in (select ddb as col1, ddf as col2
 15  		     from table(cast(vtbl as my_type_table_object
 16  				    )
 17  			       )
 18  		    ) loop
 19  	   dbms_output.put_line(to_char(vrow.col1, 'yyyy-mm-dd')
 20  				|| '	 '
 21  				|| to_char(vrow.col2, 'yyyy-mm-dd'));
 22  	end loop;

 23 end;
 24 /
1900-01-01     1900-01-01
1900-01-02     1900-01-02

PL/SQL procedure successfully completed. Received on Mon Jul 04 2005 - 21:55:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US