Home » SQL & PL/SQL » SQL & PL/SQL » Help needed regarding collect function (Oracle 10g)
Help needed regarding collect function [message #379433] Tue, 06 January 2009 07:52 Go to next message
Dhuruvan
Messages: 3
Registered: January 2009
Junior Member
whats the use of collect function
Re: Help needed regarding collect function [message #379435 is a reply to message #379433] Tue, 06 January 2009 07:55 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
What happens when you type that same question into google?
Re: Help needed regarding collect function [message #379437 is a reply to message #379435] Tue, 06 January 2009 07:57 Go to previous messageGo to next message
Dhuruvan
Messages: 3
Registered: January 2009
Junior Member
i believe Senior Members in Orafaq than google
Re: Help needed regarding collect function [message #379438 is a reply to message #379433] Tue, 06 January 2009 07:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64109
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions024.htm#i1271564

Regards
Michel
Re: Help needed regarding collect function [message #379499 is a reply to message #379433] Tue, 06 January 2009 17:05 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Since COLLECT currently works only on a single column, some might say it is of little to no use.

Good luck, Kevin
Re: Help needed regarding collect function [message #379585 is a reply to message #379499] Wed, 07 January 2009 02:56 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8631
Registered: November 2002
Location: California, USA
Senior Member
Kevin Meade wrote on Tue, 06 January 2009 15:05
Since COLLECT currently works only on a single column, some might say it is of little to no use.



That one column can be an object that contains multiple columns:

SCOTT@orcl_11g> create or replace type test_cols_typ as object
  2    (col1  varchar2(15),
  3  	col2  varchar2(15));
  4  /

Type created.

SCOTT@orcl_11g> create or replace type test_cols_tab as table of test_cols_typ;
  2  /

Type created.

SCOTT@orcl_11g> select cast (collect (test_cols_typ (dname, loc)) as test_cols_tab)
  2  from   dept
  3  /

CAST(COLLECT(TEST_COLS_TYP(DNAME,LOC))ASTEST_COLS_TAB)(COL1, COL2)
--------------------------------------------------------------------------------
TEST_COLS_TAB(TEST_COLS_TYP('ACCOUNTING', 'NEW YORK'), TEST_COLS_TYP('RESEARCH',
 'DALLAS'), TEST_COLS_TYP('SALES', 'CHICAGO'), TEST_COLS_TYP('OPERATIONS', 'BOST
ON'))


SCOTT@orcl_11g>

Re: Help needed regarding collect function [message #379587 is a reply to message #379433] Wed, 07 January 2009 03:04 Go to previous message
Barbara Boehmer
Messages: 8631
Registered: November 2002
Location: California, USA
Senior Member
Dhuruvan wrote on Tue, 06 January 2009 05:52
whats the use of collect function


http://www.oracle-developer.net/display.php?id=306
Previous Topic: Materialized view
Next Topic: oracle 10g advanced concepts (merged)
Goto Forum:
  


Current Time: Mon Dec 05 07:06:41 CST 2016

Total time taken to generate the page: 0.17282 seconds