dbTalk Databases Forums  

Order By in Nested Tables

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Order By in Nested Tables in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ExecMan
 
Posts: n/a

Default Order By in Nested Tables - 11-02-2011 , 07:48 AM






Hi,

Our application has a complex query. The query retrieves data from a
table, which contains some nested tables. I'm being asked if the
results of the nested tables can themselves be sorted. So, the query
is something like this:

SELECT .........
FROM stock_info s, TABLE(estimate_trends) s1,
TABLE(financial_overview) s2
WHERE ticker = 'IBM';

They want the results for the nested tables to themselves be sorted by
their first column, which is a sequence number.

Can this be done via normal SQL?

Reply With Quote
  #2  
Old   
joel garry
 
Posts: n/a

Default Re: Order By in Nested Tables - 11-02-2011 , 11:12 AM






On Nov 2, 6:48*am, ExecMan <artme... (AT) yahoo (DOT) com> wrote:
Quote:
Hi,

Our application has a complex query. *The query retrieves data from a
table, which contains some nested tables. *I'm being asked if the
results of the nested tables can themselves be sorted. *So, the query
is something like this:

SELECT .........
FROM stock_info s, TABLE(estimate_trends) s1,
TABLE(financial_overview) s2
WHERE ticker = 'IBM';

They want the results for the nested tables to themselves be sorted by
their first column, which is a sequence number.

Can this be done via normal SQL?
SQL is relational, nested tables are object-relational extensions to
oracle. So, I don't know.

See http://technology.amis.nl/blog/1217/...-heavy-lifting
(found by googling oracle sort results from nested table) and don't be
put off by the subject of that post, check out how the sort is done.

jg
--
@home.com is bogus.
"ORA-01536 space quote exceeded for tablespace string" - 11.2 docs

Reply With Quote
  #3  
Old   
ExecMan
 
Posts: n/a

Default Re: Order By in Nested Tables - 11-02-2011 , 02:01 PM



On Nov 2, 12:12*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Nov 2, 6:48*am, ExecMan <artme... (AT) yahoo (DOT) com> wrote:









Hi,

Our application has a complex query. *The query retrieves data from a
table, which contains some nested tables. *I'm being asked if the
results of the nested tables can themselves be sorted. *So, the query
is something like this:

SELECT .........
FROM stock_info s, TABLE(estimate_trends) s1,
TABLE(financial_overview) s2
WHERE ticker = 'IBM';

They want the results for the nested tables to themselves be sorted by
their first column, which is a sequence number.

Can this be done via normal SQL?

SQL is relational, nested tables are object-relational extensions to
oracle. *So, I don't know.

Seehttp://technology.amis.nl/blog/1217/sorting-plsql-collections-the-qui....
(found by googling oracle sort results from nested table) and don't be
put off by the subject of that post, check out how the sort is done.

jg
--
@home.com is bogus.
"ORA-01536 space quote exceeded for tablespace string" - 11.2 docs

That is a good article. I'm not 100% sure it is what I want, as I
have several nested tables, and the application wants each one sorted
be it's first column, the sequence #. I think this is a good starting
point though.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.