njain78
asked on
Query on creating Hierarchical Tree in Oracle Form
Hi,
I am trying to create a H-Tree using Record Group in Oracle Form 6.But I am getting FRM-41072 (Cannot Create Group) and FRM-41076 (error populating group). I also saw the reasons for the form failures, but everything is fine according to me.Here is my Code:
PROCEDURE ADDHTREENEW IS
htree FTREE.NODE;
htree_id ITEM;
rg_id RECORDGROUP;
rg_name VARCHAR2(40);
poprg number;
BEGIN
htree_id := FIND_ITEM('TREEDATABLK.HTR EE');
IF NOT ID_NULL (htree_id) THEN
FTREE.DELETE_TREE_NODE('HT REE',htree );
ELSE
MESSAGE('ERROR CREATING ID OF TREE');
RAISE FORM_TRIGGER_FAILURE;
END IF;
rg_id := FIND_GROUP('TREEGROUP');
rg_id := CREATE_GROUP_FROM_QUERY(rg _name,'SEL ECT 1,LEVEL,lname,NULL,to_char (SSN) from employee connect by prior ssn = superssn start with ssn = 987654321',FORM_SCOPE,20);
poprg := POPULATE_GROUP(rg_id);
FTREE.Set_Tree_Property(ht ree_id,FTR EE.RECORD_ GROUP,rg_i d);
htree := FTREE.ADD_TREE_NODE('TREED ATABLK.HTR EE',htree, FTREE.PARE NT_OFFSET, FTREE.LAST _CHILD,FTR EE.COLLAPS ED_NODE,'O RACLE','', 'ora');
END IF;
END;
In a WNF Trigger I am calling this procedure ADDHTREENEW.
Also one strange thing that I noticed- The Query passed to CREATE_GROUP_FROM_QUERY
(SELECT 1,LEVEL,lname,NULL,to_char (SSN) from employee connect by prior ssn = superssn start with ssn = 987654321) works absolutely fine in SQL PLUS.So, why it is not creating the group????
Also. I am adding one node at the last named ORACLE just to verify that tree is being actually created.
The node 'ORACLE' does appear.
I am using Forms [32 Bit] Version 6.0.8.11.3 (Production).
Thanks in advance.
I am trying to create a H-Tree using Record Group in Oracle Form 6.But I am getting FRM-41072 (Cannot Create Group) and FRM-41076 (error populating group). I also saw the reasons for the form failures, but everything is fine according to me.Here is my Code:
PROCEDURE ADDHTREENEW IS
htree FTREE.NODE;
htree_id ITEM;
rg_id RECORDGROUP;
rg_name VARCHAR2(40);
poprg number;
BEGIN
htree_id := FIND_ITEM('TREEDATABLK.HTR
IF NOT ID_NULL (htree_id) THEN
FTREE.DELETE_TREE_NODE('HT
ELSE
MESSAGE('ERROR CREATING ID OF TREE');
RAISE FORM_TRIGGER_FAILURE;
END IF;
rg_id := FIND_GROUP('TREEGROUP');
rg_id := CREATE_GROUP_FROM_QUERY(rg
poprg := POPULATE_GROUP(rg_id);
FTREE.Set_Tree_Property(ht
htree := FTREE.ADD_TREE_NODE('TREED
END IF;
END;
In a WNF Trigger I am calling this procedure ADDHTREENEW.
Also one strange thing that I noticed- The Query passed to CREATE_GROUP_FROM_QUERY
(SELECT 1,LEVEL,lname,NULL,to_char
Also. I am adding one node at the last named ORACLE just to verify that tree is being actually created.
The node 'ORACLE' does appear.
I am using Forms [32 Bit] Version 6.0.8.11.3 (Production).
Thanks in advance.
ASKER
Hi,
Actually i did check it but somehow missed in pasting it here.Truly speaking, this code was running sometime ago, and after that i went one step ahead and created WHEN-TREE-NODE-ACTIVATED trigger on a node to query employee record based on a node value.(in new EMPTEST form). I never got the result and after few tries, even the creation of tree didn't happen.I have faced this situation before also with other applications in forms.
I wish to know why does this happen???Also, kindly help me with the question assked. Thanks.
The code for this trigger is as follows:
DECLARE
htree_id ITEM;
htree_blk BLOCK;
node_value VARCHAR2(2000);
BEGIN
htree_id := FIND_ITEM('TREE');
IF NOT ID_NULL(htree_id) THEN
node_value :=
FTREE.GET_TREE_NODE_PROPER TYhtree_id ,:SYSTEM.T RIGGER_NOD E,FTREE.NO DE_VALUE);
SET_BLOCK_PROPERTY('F:\tes t\emptest. fmx',DEFAU LT_WHERE,' EMPLOYEE.L NAME = ' || node_value);
open_form('F:\test\emptest .fmx');
GO_BLOCK('EMPLOYEE');
EXECUTE_QUERY();
ELSE
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;
Actually i did check it but somehow missed in pasting it here.Truly speaking, this code was running sometime ago, and after that i went one step ahead and created WHEN-TREE-NODE-ACTIVATED trigger on a node to query employee record based on a node value.(in new EMPTEST form). I never got the result and after few tries, even the creation of tree didn't happen.I have faced this situation before also with other applications in forms.
I wish to know why does this happen???Also, kindly help me with the question assked. Thanks.
The code for this trigger is as follows:
DECLARE
htree_id ITEM;
htree_blk BLOCK;
node_value VARCHAR2(2000);
BEGIN
htree_id := FIND_ITEM('TREE');
IF NOT ID_NULL(htree_id) THEN
node_value :=
FTREE.GET_TREE_NODE_PROPER
SET_BLOCK_PROPERTY('F:\tes
open_form('F:\test\emptest
GO_BLOCK('EMPLOYEE');
EXECUTE_QUERY();
ELSE
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;
I think that you would upgrade your Forms to higher version, we use Forms [32 Bit] Verzia 6.0.8.21.3 (Produkcia). I use tree with no problems there. It seems that it is a bug since you have written that "I have faced this situation before also with other applications in forms.".
Henka
Henka
I have forgotten to mention that if there are more than 1800 nodes in a tree you must upgrade your Forms builder.
ASKER
Hi Henka,
My SQL query just returns me 3 rows.Here it is:
select 1, level, lname, NULL, to_char(ssn) from employee
connect by prior ssn = superssn start with ssn = 987654321;
1 LEVEL LNAME N TO_CHAR(SSN)
---- --------- --------------- - ---------------------
1 1 WALLACE 987654321
1 2 ZELAYA 999887777
1 2 JABBAR 987987987
As i said earlier,in my second comment, query was running fine.so I think form upgrade is not necessary.
I also tried to build application afresh but in vain.
My SQL query just returns me 3 rows.Here it is:
select 1, level, lname, NULL, to_char(ssn) from employee
connect by prior ssn = superssn start with ssn = 987654321;
1 LEVEL LNAME N TO_CHAR(SSN)
---- --------- --------------- - ---------------------
1 1 WALLACE 987654321
1 2 ZELAYA 999887777
1 2 JABBAR 987987987
As i said earlier,in my second comment, query was running fine.so I think form upgrade is not necessary.
I also tried to build application afresh but in vain.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Henka,
Sorry for the delay.This code worked but when i went ahead to use node selected trigger as mentioned above, NODE_VALUE is returning me 'NULL'. Hence no employee record is shown. Kindly help me.
Sorry for the delay.This code worked but when i went ahead to use node selected trigger as mentioned above, NODE_VALUE is returning me 'NULL'. Hence no employee record is shown. Kindly help me.
I don't understand: If you doubleclick on a node in a tree then the ftree.NODE_VALUE for SYSTEM.TRIGGER_NODE is NULL ?
ASKER
Thans henka, It's now working perfectly fine.
IF ID_NULL( rg_id ) THEN
rg_id := CREATE_GROUP_FROM_QUERY(rg
END IF;