Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96

    Unanswered: Oracle COLLECT collection function

    Hello,

    In Oracle, it allow to use COLLECT to aggregate data into a collection and retaining multiple records within a single row (nested table).
    Is there any similar function or workaround to create the same to achieve this?

    One of the example of PLSQL code.

    CREATE TYPE phone_book_t AS TABLE OF phone_list_typ;
    /
    SELECT CAST(COLLECT(phone_numbers) AS phone_book_t)
    FROM customers;

    http://docs.oracle.com/cd/B19306_01/...nctions024.htm

    Thank you in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96
    I found out the way to use XMLGROUP and XMLCAST to replace COLLECT string aggregation.

  3. #3
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    listagg may be of use as well
    Andy

    "All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can’t get them together again, there must be a reason. By all means, do not use hammer.” — IBM maintenance manual, 1975 "

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •