dbTalk Databases Forums  

Collection

comp.databases.oracle.server comp.databases.oracle.server


Discuss Collection in the comp.databases.oracle.server forum.



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

Default Collection - 06-24-2010 , 10:07 AM






Hi,

This query basically does that I want:

SELECT body_id, COLLECT(m_ticker) AS m_ticker
FROM zc_body zb, zc_ticker_body zt
WHERE zb.body_id = zt.id
AND body_id = 39
GROUP BY body_id;

BODY_ID
----------
M_TICKER
--------------------------------------------------------------------------------
39
SYSTPicg9tK7GadHgQAB/AQBGww==('LNUX', 'MSFT', 'RHAT')


However, I really do not need that strange ID. Any way to chop it
off?

Reply With Quote
  #2  
Old   
Randolf Geist
 
Posts: n/a

Default Re: Collection - 06-27-2010 , 03:59 PM






On Jun 24, 5:07*pm, The Magnet <a... (AT) unsu (DOT) com> wrote:
Quote:
However, I really do not need that strange ID. * Any way to chop it
off?
I suggest that you read Adrian Billington's article on the COLLECT
function where it is also explained where these system generated types
come from: http://www.oracle-developer.net/display.php?id=306

In a nutshell: You can't prevent them from being generated by the
COLLECT function but you can create you own type and use the CAST
function to get the desired collection type.

Regards,
Randolf

Oracle related stuff blog:
http://oracle-randolf.blogspot.com/

Co-author of the "OakTable Expert Oracle Practices" book:
http://www.apress.com/book/view/1430226684
http://www.amazon.com/Expert-Oracle-.../dp/1430226684

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.