?
Solved

Adding data to a Hierarchical tree

Posted on 2007-10-01
5
Medium Priority
?
1,331 Views
Last Modified: 2013-12-19
i am having a tree with nodes as A-Z. i need to add data to these nodes from another table such that node A is having data as.. names of all the employees starting with alphabet 'A'..etc
i am using a procedure to retreive the data.
PROCEDURE proc_add_tree_data(str char) IS
BEGIN
 
 declare
  htree         ITEM;            
CURSOR cur_tree_query IS
   select distinct emp_first_name
         from emp_info_hdr
         where emp_first_name like str||'%';
         ename emp_info_hdr.emp_first_name%type;
        begin
              htree := Find_Item('BLOCK_TREE.HTREE');
              open cur_tree_query;
         LOOP
               fetch cur_tree_query into ename;
               Ftree.Add_Tree_Data(htree,
               Ftree.ROOT_NODE,
               Ftree.PARENT_OFFSET,
               Ftree.LAST_CHILD,
               Ftree.QUERY_TEXT,
               ename);
         
               exit when cur_tree_query%notfound;
         end loop;
         close cur_tree_query;
          
         END ;
 
END;

but this cursor is giving me error...invalid query for hierarchical tree.
0
Comment
Question by:fyzalkabu
  • 3
3 Comments
 
LVL 22

Expert Comment

by:Helena Marková
ID: 19989738
I see that this procedure is used in Forms.
There is no "ename" there.
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 19989751
Oh sorry, now I see "ename".
0
 
LVL 22

Accepted Solution

by:
Helena Marková earned 2000 total points
ID: 19989778
You cannot use ADD_TREE_DATA, because parameter "data" can be:
Specifies the data to be added. If data source is QUERY_TEXT, then data is the text of the query. If data source is RECORD_GROUP, then data is an item of type RECORDGROUP or the name of a record group.

You can use ADD_TREE_NODE in your procedure.

If you have access to MetaLink you can read Note:210663.1 - "FTREE documentation".
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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…
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

831 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