Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Query on hierarchical tree in Oracle Forms

Posted on 2003-02-22
5
Medium Priority
?
11,527 Views
Last Modified: 2013-12-12
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.
0
Comment
Question by:njain78
  • 3
5 Comments
 
LVL 22

Expert Comment

by:Helena Marková
ID: 8006769
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
 

Author Comment

by:njain78
ID: 8006951
Hi Henka,

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








0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 8007111
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
 
LVL 22

Expert Comment

by:Helena Marková
ID: 10152738
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10214492
PAQed - no points refunded (of 20)

Computer101
E-E Admin
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

581 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