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: table(cast(nested table)) : what is the column name?

Re: table(cast(nested table)) : what is the column name?

From: yossarian <yossarian99_at_operamail.com>
Date: Fri, 18 May 2007 13:25:44 +0200
Message-ID: <464d8d07$0$21214$5fc30a8@news.tiscali.it>


yossarian wrote:

> SQL> run
> 1 declare
> 2 arr t := t () ;
> 3 x integer ;
> 4 begin
> 5 arr.extend(3);
> 6 arr(1) := 42 ;
> 7 arr(2) := 94 ;
> 8 arr(3) := 127 ;
> 9 select sum (INeedAColumnNameHere) into x from table ( cast ( arr
> as t ) ) ;
> 10* end ;
> select sum (INeedAColumnNameHere) into x from table ( cast ( arr as t
> ) ) ;
> *
> ERROR at line 9:
> ORA-06550: line 9, column 15:
> PL/SQL: ORA-00904: invalid column name
> ORA-06550: line 9, column 3:
> PL/SQL: SQL Statement ignored
>
> What column name have I to put in there?

Sorry, the answer is in the docs (surprise!):

<<<
When datatype is a scalar type, then the nested table type describes a table with a single, scalar type column called "column_value". >>>

Thank you. Kind regards, Y. Received on Fri May 18 2007 - 06:25:44 CDT

Original text of this message

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