Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    8

    Question Unanswered: DB2 equivalent of Oracle's nested tables

    Is there a nested table kind of user defined type in DB2? For example, in oracle I can define a new type as a nested table of integers as:

    CREATE TYPE table_type AS TABLE OF INTEGER;

    and then use it in a table definition as:

    CREATE TABLE R(
    a INTEGER,
    b table_type)
    NESTED TABLE b STORE as b_1;

    Can I do something like this in DB2? I am using DB2PE v8.1.3.132 with fixpack 3.

    Thank you,
    Laura

  2. #2
    Join Date
    Feb 2002
    Location
    Philippines
    Posts
    41
    try to get the Oracle to DB2 UDB Conversion Guide (sg247048) redbook... a link can be found in one of the sticky threads.

    there is a discussion in that book regarding the conversion nested tables and arrays

    hope that helps
    There are 10 kinds of people,
    those who know binary and those who don't.

    http://www.linkedin.com/in/rtitong

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by laurici
    Is there a nested table kind of user defined type in DB2? For example, in oracle I can define a new type as a nested table of integers
    I guess your question should sound rather like this: "I want to accomplish this and that. In Oracle I would use nested tables to do that. What's the best way to do the same thing in DB2?" :-)

    Not knowing what is the purpose of using "nested tables" I can only suggest reading about structured user defined types and typed tables in the DB2 SQL reference - may be that's what you need.

  4. #4
    Join Date
    Oct 2003
    Posts
    8
    romeo, thank you for the pointer. I checked it out, and apparently, there is no equivalent to nested tables in DB2.

    n-i, you are right, that should have been the correct phrasing in a normal oracle->db2 migration situation. the problem though is that i'm working on a research prototype, and oracle's nested table were exactly what we would have needed... there was a question of whether or not we could implement our prototype on top of some other RDBMS (DB2 for example) without too much hassle (that is, if the schema design remains the same – perhaps with minor changes- we don’t have to rewrite all our algorithms). That's why I was interested if DB2 supports nested tables as such, and hence the way I phrased my question.

    Laura

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by laurici
    That's why I was interested if DB2 supports nested tables as such, and hence the way I phrased my question.
    See, the problem is that very few people attending this discussion know what a "nested table" is. We may be familiar with DB2 but not with Oracle. A concept that Oracle calls "nested tables" may exist in DB2 but most likely it will have a different name. This is why I suggested you stating the problem, not the solution.

  6. #6
    Join Date
    Oct 2004
    Location
    Norway
    Posts
    53
    As far as I know, the "Nested Table" structure in Oracle, is a ORDBMS property. It is, by my knowledge not possible in DB2. May be an option in v. 8 though.

    ---

    Regards

    Filip Poverud

Posting Permissions

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