Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ISLEAF explanation

Posted on 2013-06-07
2
Medium Priority
?
539 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 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Suggested Courses

963 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