Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Location
    under the sun
    Posts
    1

    Unanswered: Viewing data from a tree problem

    hello guys, I'm having a problem with my h. tree,. When I would click a node, it displays the data twice. But what I needed is to display it only once. And when I'd click another node, it goes down to next item and displays twice again.

    this is the screenshot of my form
    http://i43.tinypic.com/15y1ja.jpg

    and this is my current code:
    Code:
    DECLARE
    	mytree ITEM;
      label_of_mynode VARCHAR2(100);
      label_of_myParent VARCHAR2(100);
      
      pos  NUMBER;
      
       	CURSOR subj_cur IS
          SELECT s.subj_code, ss.day, ss.starttime, ss.endtime
            FROM subjects s, subjsec ss
             	WHERE s.subj_Code = ss.subj_code
             		AND s.subj_Code = label_of_mynode
             			ORDER BY s.subj_code ASC;
             		
    BEGIN
    
    	    IF (:System.trigger_node_selected = 'TRUE') then
    					-- Find out the tree
    					mytree := Find_Item('tree.tree');
    					-- Get the value of the node clicked on.
    					-- value_of_mynode := Ftree.Get_Tree_Node_Property(mytree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);
    					label_of_mynode := Ftree.Get_Tree_Node_Property(mytree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_LABEL);   	
    	    END IF;
    	    
    GO_BLOCK('MAIN');
    pos := :system.cursor_record;
    message('FOR loop');
    FOR subj_rec IN subj_cur
    LOOP
    	message('FOR loop - subj_code = ' || subj_rec.subj_code);
    	
    --	:main.txtsection := label_of_mynode;  
    	:main.subject := subj_rec.subj_code;
    	NEXT_RECORD;
    END LOOP;
    message('Step 4 - out of loop');
    
    END;

    PLs. do help me, i'm stuck with this.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    You haven't tried using Oracle's Hierarchical SQL extensions for SELECT? (START WITH, CONNECT BY, LEVEL pseudo column)

    REF Hierarchical Queries
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •