?
Solved

Query on hierarchical tree in Oracle Forms

Posted on 2003-02-22
5
Medium Priority
?
11,467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

777 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