Results 1 to 2 of 2

Thread: Collections

  1. #1
    Join Date
    Dec 2003

    Unanswered: Collections

    Could someone give me their take on defining TYPEs for use in collections. Why are the first 2 types required to be declared? Is the type "rec" ever used outside of a collection situation? I suppose I'm mainly confused by the requirement for 2 TYPE declarations, as it seems like more to maintain - always 2 types when you want to build a PL/SQL collection? I'm just trying to find a memory aid for this by understanding why it has to be this way ...

    SQL create or replace
      2  type rec is object
      3    ( a number,
      4      b number,
      5      c varchar2(30));
      6  /
    Type created.
    SQL create or replace
      2  type rec_list is
      3  table of rec;
      4  /
    Type created.
    SQL declare
      2  r rec_list;
      3  begin
      4    null
      5  end;

  2. #2
    Join Date
    Jun 2003
    West Palm Beach, FL


    First type = Single object

    Second type = Array (table, collection) of objects type (of first type).

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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