Solved

ISLEAF explanation

Posted on 2013-06-07
2
511 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
ID: 39230744
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
ID: 39230852
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
help on oracle query 5 52
Create Index on a Materialized View 5 32
what privileges needed for S2 for this function (Oracle 12c)? 3 22
oracle numeric condition check 4 27
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

808 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