Solved

ISLEAF explanation

Posted on 2013-06-07
2
503 Views
Last Modified: 2013-06-07
Experts,

I am a beginner with these functions and I'm hoping someone can explain the ISLEAF results in this query. The results are producing the correct hierarchy.

SELECT ETC_ID,    SYS_CONNECT_BY_PATH(etc_id, '$') ids,
                   SYS_CONNECT_BY_PATH(etc_name, '$') names,
                   CONNECT_BY_ISLEAF isleaf
              FROM ETC_TBL
              WHERE ETC_RETIRED_IND = 0
        CONNECT BY ETC_PARENT_ETC_ID = PRIOR etc_id
        START WITH ETC_PARENT_ETC_ID = 0

I attached a sample Excel output of a few records.
I am wondering why the first 2 records have ISLEAF = 0 (High level explanation of why I should expect that result)
isleaf-example.xlsx
0
Comment
Question by:jvoconnell
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
Comment Utility
I assume you have been to the docs for this?

http://docs.oracle.com/cd/E11882_01/server.112/e26088/pseudocolumns001.htm#SQLRF50940

CONNECT_BY_ISLEAF Pseudocolumn

The CONNECT_BY_ISLEAF pseudocolumn returns 1 if the current row is a leaf of the tree defined by the CONNECT BY condition. Otherwise it returns 0. This information indicates whether a given row can be further expanded to show more of the hierarchy.
0
 
LVL 1

Author Closing Comment

by:jvoconnell
Comment Utility
Thank you. I did check online before posting but was strictly limiting myself (out of frustration) to "isleaf".  On the specific link you posted, the "LEVEL" psuedocolumn helped clarify things. I appreciate your time, you helped me out once again.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now