Home » Developer & Programmer » Forms » what's wrong with this code? (db10g,form 6i)
what's wrong with this code? [message #543381] |
Tue, 14 February 2012 08:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
can anyone tell me why this code generating error "INVALID ITEM OR INVALID ID" my table structure & data as giving below.
TR NAME MANUE_NAME
01 Main
02 Forms
0101 Design DESIGNS
0102 M_PRODUCT PRODUCTS
0103 Sizes SIZES
03 Reports
0301 Lpo Reports
0302 Routine Purchase Report
0303 Sales Report
and WHEN-NEW-FORM-INSTAN CODE
Declare
htree item;
top_node ftree.node
new_node ftree.node;
child_node ftree.node;
child_node ftree.node;
item_code varchar(30);
cursor prim_cur is select tr,name from manue where length(tr)=2;
cursor child_cur(t varchar2) is select tr,name from manue where length(tr)=4 and substr(tr,1,2)=t;
cursor child_cur1(t1 varchar2) is select tr,name from manue where length(tr)=6 and substr(tr,1,4)=t1;
begin
for dummy in prin_cur loop
new_node:=ftree.add_tree_node(htree,ftree.root_node,ftree.parent_offset,ftree.last_child,ftree.expanded_node,dummy.name,'f:\icons\a,' dummy.tr);
for child in child_cur(dummy.tr) loop
child_node:=ftree.add_tree_node(htree,new_node,ftree.parent_offset,ftree.last_child,ftree.expanded_node,child.name,'f:\icons\go',chil d.tr);
for child1 in child_cur1(child.tr) loop
child_node1:=ftree.add_tree_node(htree,child_node,ftree.parent_offset,ftree.last_child,ftree.expanded_node,child1.name,'f:\icons\go', child1.tr);
end loop;
end loop;
end loop;
end;
kindly answer as soon as possible
thanks in advance
[Updated on: Tue, 14 February 2012 08:47] Report message to a moderator
|
|
|
|
|
Re: what's wrong with this code? [message #543440 is a reply to message #543388] |
Tue, 14 February 2012 14:07 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
sorry sir i formatted the code but when i applied msg i dont why it
instantly changed i dont know why next time i shall try to post in proper way here is a Error img which i'm uploading.
DECLARE
htree ITEM;
top_node FTREE.NODE ;
new_node FTREE.NODE ;
child_node FTREE.NODE ;
child_node1 FTREE.NODE ;
item_value VARCHAR2(30);
cursor prime_cur is SELECT RE,NAME FROM MANUE WHERE LENGTH(RE)=2;
cursor child_cur(T varchar2) is SELECT RE ,NAME FROM MANUE WHERE
LENGTH(RE)=4 AND SUBSTR(RE,1,2)=T;
cursor child_cur1(t1 varchar2) is SELECT RE,NAME FROM MANUE WHERE
LENGTH(RE)=6 AND SUBSTR(RE,1,4)=t1;
BEGIN
--Find the tree itself.htree := Find_Item('tmp.tree4');
for dummy in prime_cur loop
new_node := Ftree.Add_Tree_Node(htree,
ftree.root_node,Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,Ftree.EXPANDED_NODE,
dummy.name,'f:\ICONS\a',dummy.RE);
for child in child_cur(dummy.RE) loop
child_node := Ftree.Add_Tree_Node
(htree,new_node,Ftree.PARENT_OFFSET,Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,child.name,'f:\ICONS\GO',child.RE);
for child1 in child_cur1(child.RE) loop
child_node1 := Ftree.Add_Tree_Node(htree,
CHILD_NODE,Ftree.PARENT_OFFSET,Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,c hild1.name,'f:\ICONS\GO',child1.RE);
end loop;
end loop;
end loop;
END;
Thanks & best regards
-
Attachment: error.PNG
(Size: 65.92KB, Downloaded 810 times)
[Updated on: Tue, 14 February 2012 14:22] Report message to a moderator
|
|
|
|
Re: what's wrong with this code? [message #543476 is a reply to message #543445] |
Wed, 15 February 2012 00:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
You call that code FORMATTED? Not even close! Enclosing it into the [code] tags is not enough.
This is formatted - do so when posting your next messages.
DECLARE
htree ITEM;
top_node FTREE.NODE;
new_node FTREE.NODE;
child_node FTREE.NODE;
child_node1 FTREE.NODE;
item_value VARCHAR2 (30);
CURSOR prime_cur
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 2;
CURSOR child_cur (T VARCHAR2)
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 4 AND SUBSTR (RE, 1, 2) = T;
CURSOR child_cur1 (t1 VARCHAR2)
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 6 AND SUBSTR (RE, 1, 4) = t1;
BEGIN
--Find the tree itself.htree := Find_Item('tmp.tree4');
FOR dummy IN prime_cur
LOOP
new_node :=
Ftree.ADD_TREE_NODE (htree,
ftree.root_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
dummy.name,
'f:\ICONS\a',
dummy.RE);
FOR child IN child_cur (dummy.RE)
LOOP
child_node :=
Ftree.ADD_TREE_NODE (htree,
new_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
child.name,
'f:\ICONS\GO',
child.RE);
FOR child1 IN child_cur1 (child.RE)
LOOP
child_node1 :=
Ftree.ADD_TREE_NODE (htree,
CHILD_NODE,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
child1.name,
'f:\ICONS\GO',
child1.RE);
END LOOP;
END LOOP;
END LOOP;
END;
Did you check items name spelling?
|
|
|
|
Re: what's wrong with this code? [message #543610 is a reply to message #543609] |
Wed, 15 February 2012 14:07 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
cookiemonster wrote on Tue, 14 February 2012 22:03cookiemonster wrote on Tue, 14 February 2012 15:17use messages to determine which exact line is causing the error.
|
|
|
|
|
Re: what's wrong with this code? [message #543883 is a reply to message #543615] |
Fri, 17 February 2012 06:20 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
create table manue(re varchar2(9),
name varchar2(25),
manue_name varchar2(25));
insert into manue
values('01','Main',null);
insert into manue
values('02','Forms',null);
insert into manue
values('0101','Design','DESIGNS');
insert into manue
values('0102','m_products','PRODUCTS');
insert into manue
values('0103','Sizes','SIZES');
insert into manue
values('03','Reports',null);
insert into manue
values('0301','Lpo','Report');
insert into manue
values('0302','Purchase Report',null);
insert into manue
values('0303','Sales Report',null);
/
commit;
i have uploaded fmb file try to run with u might be u will find something this time and also requesting to all seniors pls download this fmb file and point out where i'm wrong OR tell me simply how to run only reports .rep file through tree menu. i hope this time i shall get some answer from experts for the new commers in this forum.
thanks in advance
-
Attachment: TREE_EXP.fmb
(Size: 56.00KB, Downloaded 1102 times)
[Updated on: Fri, 17 February 2012 06:50] Report message to a moderator
|
|
|
Re: what's wrong with this code? [message #543894 is a reply to message #543610] |
Fri, 17 February 2012 06:55 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
ThomasG wrote on Wed, 15 February 2012 20:07cookiemonster wrote on Tue, 14 February 2012 22:03cookiemonster wrote on Tue, 14 February 2012 15:17use messages to determine which exact line is causing the error.
If you don't understand what that means say so.
You need to put pairs of the message builtin between each line of existing code so you can at what point the error occurs. ie:
BEGIN
message(1);
message(1);
--Find the tree itself.htree := Find_Item('tmp.tree4');
FOR dummy IN prime_cur
LOOP
message(2);
message(2);
new_node :=
Ftree.ADD_TREE_NODE (htree,
ftree.root_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
dummy.name,
'f:\ICONS\a',
dummy.RE);
message(3);
message(3);
FOR child IN child_cur (dummy.RE)
LOOP
message(4);
message(4);
.....
.....
Do that and tell us which line is causing the error. We will not help you until you do.
|
|
|
Re: what's wrong with this code? [message #543925 is a reply to message #543894] |
Fri, 17 February 2012 12:35 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
i think i found the problem in which line i think
DECLARE
htree ITEM;
top_node FTREE.NODE;
new_node FTREE.NODE;
child_node FTREE.NODE;
child_node1 FTREE.NODE;
item_value VARCHAR2 (30);
CURSOR prime_cur
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 2;
CURSOR child_cur (T VARCHAR2)
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 4 AND SUBSTR (RE, 1, 2) = T;
CURSOR child_cur1 (t1 VARCHAR2)
IS
SELECT RE, NAME
FROM MANUE
WHERE LENGTH (RE) = 6 AND SUBSTR (RE, 1, 4) = t1;
BEGIN
--Find the tree itself.htree := Find_Item('tmp.tree4');
FOR dummy IN prime_cur
LOOP
-----------------I think here is the problem null value
message(new_node);
message(new_node);
new_node :=
Ftree.ADD_TREE_NODE (htree,
ftree.root_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
dummy.name,
'f:\ICONS\a',
dummy.RE);
message(dummy.re);
message(dummy.re);
message(dummy.name);---value comming 1.Menu 2.Forms 3.Reports
message(dummy.name);
--value is comming null am i right sir now solution please
-----------------------------------------------------
FOR child IN child_cur (dummy.RE)
LOOP
child_node :=
Ftree.ADD_TREE_NODE (htree,
new_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
child.name,
'f:\ICONS\GO',
child.RE);
FOR child1 IN child_cur1 (child.RE)
LOOP
message(child.re);
message(child.re);
message(child_node1);
message(child_node1);
child_node1 :=
Ftree.ADD_TREE_NODE (htree,
CHILD_NODE,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
child1.name,
'f:\ICONS\GO',
child1.RE);
END LOOP;
END LOOP;
END LOOP;
END;
if i'm right thn pls solution
thanks
[Updated on: Fri, 17 February 2012 12:54] Report message to a moderator
|
|
|
|
|
Re: what's wrong with this code? [message #543931 is a reply to message #543930] |
Fri, 17 February 2012 13:38 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](//www.gravatar.com/avatar/1229663c86eb1a441385fe710cd9116e?s=64&d=mm&r=g) |
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
sometime due to heavy work of load its happening the problem was very minor but i was confusing anwayz thanks for giving me a clues and not telling the exact problem & allowed me to do my self.
Thanks & best regard
|
|
|
Goto Forum:
Current Time: Sun Feb 09 21:39:10 CST 2025
|