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: Oracle8 nested table flatten query

Re: Oracle8 nested table flatten query

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 11 Mar 1999 21:00:08 GMT
Message-ID: <36f7268c.30523931@192.86.155.100>


A copy of this was sent to sbenda_at_my-dejanews.com (if that email address didn't require changing) On Thu, 11 Mar 1999 18:48:51 GMT, you wrote:

>Hello,
>
>I need to select all records from nested table. Below is set of statements
>ended by error. In fact what I need is:
>

you cannot. Each row of a table that contains a nested table points to a 'virtual' table. Each and every row has a "virtually unique" table it points to. Thats the whole concept behind the nested table...

You have to pick exactly 1 nested table to 'flatten'. Thats why the first query with rownum=1 works.

>select * from bb;
>
>bb is table where nested table is stored. But there is impossible to reference
>nested table. Any idea? What I missed up?
>
>Please post to me as well.
>
>Stanislav Benda
>email:si_bendovi_at_hotmail.com
>
>
>SQL> select b from b;
>
>B(A, B)
>-----------------------------------------------------------------------------
>--- -------------------- TB(TA(1, 1), TA(2, 3)) TB(TA(1, 1), TA(2, 2), TA(3,
>3)) TB(TA(1, 1), TA(2, 2), TA(3, 3), TA(4, 4))
>
>SQL> select b from b where rownum = 1;
>
>B(A, B)
>-----------------------------------------------------------------------------
>--- -------------------- TB(TA(1, 1), TA(2, 3))
>
>SQL> select * from the ( select b from b where rownum = 1);
>
> A B
>--------- ---------
> 1 1
> 2 3
>
>SQL> select * from the ( select b from b);
>select * from the ( select b from b)
> *
>ERROR at line 1:
>ORA-01427: single-row subquery returns more than one row
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Mar 11 1999 - 15:00:08 CST

Original text of this message

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