Home » Developer & Programmer » Forms » FRM-47321: Data USed to populate tree is invalid (Forms 61,Oracle 9i)
FRM-47321: Data USed to populate tree is invalid [message #309379] Thu, 27 March 2008 04:52 Go to next message
oracle_me
Messages: 59
Registered: March 2008
Member
Hello ,

I have a table :
QL> create table rel ( parent varchar2(20), child varchar2(20) ) ;

Table created

SQL> insert into rel values ( 'babar','humayun');

1 row inserted

SQL> insert into rel values ( 'humayun','akbar');

1 row inserted

SQL> insert into rel values ( 'akbar','Jehangir');

1 row inserted

SQL> insert into rel values ( 'akbar','Salem');

1 row inserted

SQL> insert into rel values ( 'Jehangir','shahjahan');

1 row inserted

SQL> insert into rel values ( 'Jehangir','Salim');

1 row inserted

SQL> insert into rel values ( 'shahjahan','Auragazeb');

1 row inserted

SQL> commit;


I wanted to create a tree item with this.

DECLARE
htree ITEM;
v_ignore NUMBER;
rg_capitals RECORDGROUP;
v_cap VARCHAR2(50);

BEGIN
htree := FIND_ITEM('ctree');

rg_capitals := FIND_GROUP('capitals');

IF NOT ID_NULL(rg_capitals)
THEN DELETE_GROUP(rg_capitals);
END IF;

rg_capitals := CREATE_GROUP_FROM_QUERY('rg_capitals',
'select level,parent, child from rel connect by prior child = parent start with parent = ''babar'' order by level');

v_ignore := POPULATE_GROUP(rg_capitals);

FTREE.SET_TREE_PROPERTY(htree, FTREE.RECORD_GROUP, rg_capitals);

FTREE.POPULATE_TREE(htree);
END;


Please tell me what is wrong here .I cannot figure out the error.
I have done ENOUGH of reading of all the threads here ,however I am not able to fix this .
Also later I modified the code as :
Ftree.Add_Tree_Data(htree,
Ftree.ROOT_NODE,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.RECORD_GROUP,
rg_capitals);

Instead of populate_tree , still no use.
Please fix thsi for me..Experts ..help plz..

Re: FRM-47321: Data Used to populate tree is invalid [message #309399 is a reply to message #309379] Thu, 27 March 2008 05:57 Go to previous message
oracle_me
Messages: 59
Registered: March 2008
Member
Hi ,
I have found something.
When I use the standard emp table example which goes like this :


rg_emps := Create_Group_From_Query('rg_emps',
'select 1, level, ename, NULL, to_char(empno) ' ||
'from emp ' ||
'connect by prior empno = mgrid ' ||
'start with job = ''PRESIDENT''');

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);



Now It works .However even in this query if I remove any one column , say the first on eand re-write the query as
'select level, ename, NULL, to_char(empno) ' ||
'from emp ' ||
'connect by prior empno = mgrid ' ||
'start with job = ''PRESIDENT'''


NOTE : I have removed '1' ,It gives the error now.
So, Has it got something to do with the number of columns and what they are?
If so,Please throw some light on that.

Previous Topic: help plzzz, its urgent
Next Topic: how to print a form with inserted data
Goto Forum:
  


Current Time: Fri Apr 26 20:47:18 CDT 2024