Query on hierarchical tree in Oracle Forms

Few questions...

1)Can you please elaborate on the SELECT....START WITH....
CONNECT BY.. CLAUSE. which we use in creating Record Group
for populating Tree.

2)Moreover my EMP table has foll. structure.

 (FNAME           VARCHAR2(15),
  MINIT           VARCHAR2(2),
  LNAME           VARCHAR2(15),
  SSN             NUMBER(12) NOT NULL,
  BDATE           DATE,
  ADDRESS         VARCHAR2(35),
  SEX             VARCHAR2(1),
  SALARY          NUMBER(7) NOT NULL,
  SUPERSSN        NUMBER(12),
  DNO             NUMBER(2) NOT NULL) ;

How will i modify the above SELECT....START WITH....
query to populate tree item with my EMP table.Why normal SELECT statements are not effective here.

3)Suppose user wants to create the nodes manually without populating it from any table.How he shoould go about it???

I am using Forms [32 Bit] Version 6.0.8.11.3 (Production)

Thanks in advance.
njain78Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helena Markováprogrammer-analystCommented:
I think that answers to your questions you can find in the Forms on-line help (About hierarchical trees and related topics:Format of data used to populate a hierarchical tree
...). There are also examples there.

2) see SET_TREE_PROPERTY built in example
3) see Adding a Node to Hierarchical Tree

Henka
0
njain78Author Commented:
Hi Henka,

 That's fine.I had already gone thru' it.But waht about my Question 2 and 3.Plz. answer.








0
Helena Markováprogrammer-analystCommented:
2)
/*
** Built-in:  SET_TREE_PROPERTY
*/

-- This code could be used in a WHEN-NEW-FORM-INSTANCE
-- trigger to initially populate the hierarchical tree
-- with data.

DECLARE
   htree         ITEM;
   v_ignore      NUMBER;
   rg_emps       RECORDGROUP;
BEGIN
   -- Find the tree itself.
   htree := Find_Item('tree_block.htree3');

   -- Check for the existence of the record group.
   rg_emps := Find_Group('emps');
   IF NOT Id_Null(rg_emps) THEN
      DELETE_GROUP(rg_emps);
   END IF;

   -- Create the record group.
   rg_emps := Create_Group_From_Query('rg_emps',
'select 1, level, lname, NULL, to_char(ssn) from emp connect by prior ssn = superssn start with ssn = 1');

   -- Populate the record group with data.
   v_ignore := Populate_Group(rg_emps);

   -- Transfer the data from the record group to the hierarchical

   -- tree and cause it to display.
   Ftree.Set_Tree_Property(htree, Ftree.RECORD_GROUP, rg_emps);
END;

3)
/*  

** Built-in:  ADD_TREE_NODE
*/

-- This code copies a value from a Form item and
-- adds it to the tree as a top level node.  The
-- value is set to be the same as the label.

DECLARE
   htree         ITEM;
   top_node      FTREE.NODE;
   new_node      FTREE.NODE;
   item_value    VARCHAR2(30);
BEGIN
   -- Find the tree itself.
   htree := Find_Item('tree_block.htree3');

   -- Copy the item value to a local variable.
   item_value := :wizard_block.new_node_data;

   -- Add an expanded top level node to the tree
   -- with no icon.
   new_node := Ftree.Add_Tree_Node(htree,
                                   Ftree.ROOT_NODE,
                                   Ftree.PARENT_OFFSET,
                                   Ftree.LAST_CHILD,
                                   Ftree.EXPANDED_NODE,
                                   item_value,
                                   NULL,
                                   item_value);
END;
0
Helena Markováprogrammer-analystCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/No Refund.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Henka
EE Cleanup Volunteer
0
Computer101Commented:
PAQed - no points refunded (of 20)

Computer101
E-E Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.