Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only

Hierarchical Query/Clause Problem

  • 1.  Hierarchical Query/Clause Problem

    Posted 7 days ago
      |   view attached

    I'm having trouble with a hierarchical query.  I have a table of 289 records on which I'm running the following query and it ends up being an infinite loop.  Does anyone have an idea about what I might be doing wrong?

    create temp table tmp_sub(item_code char(24), sub_item_code char(24));

    I've attached the sample data file.

    SELECT item_code, sub_item_code, LEVEL level,
     CONNECT_BY_ISLEAF leaf, CONNECT_BY_ISCYCLE cycle, CONNECT_BY_ROOT item_code rt
    FROM tmp_sub
    START WITH item_code = "JVC2SA1037K(QR)-W"
    CONNECT BY NOCYCLE PRIOR item_code = sub_item_code;

    Thanks.



    ------------------------------
    Daniel Karwatka
    ------------------------------

    Attachment(s)

    txt
    tmpsub.unl.txt   7 KB 1 version