Skip to Main Content

Null value in hierarchical query for APEX tree view in APEX 5.1

Madona328-OracleAug 14 2018 — edited Aug 15 2018

I need to develop a tree view  for a table ,the connection being provided by two columns 'sample' and 'sample_source'.

I use a hierarchical sql query for that .

The sample code is given below:

select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status,

        level,

        sample as title,

        'icon-tree-folder' as icon,

        sample as value,

        sample as tooltip,

        null  as link

   from (select sample,sample_source from table_name  group by (sample,sample_source))

  start with sample is null

connect by prior sample=sample_source

  order siblings by sample

Here my problem is that. In the first level, both sample and sample_source are null. In the next level,sample is not null, sample_source will be null . Remaining all levels sample and sample_source are not null.

So using the above query I am not able to make the connection from first to second level (may be because of null values) so that the tree wont be displayed..

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Sep 12 2018
Added on Aug 14 2018
1 comment
86 views