General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to resolve structured data ??
Hello Everbody
We have a table rbobjekte with structured data (like bill of material)
rbobjekteid ,rboberobjektid (the objectid of the object above), .....
The startpoint of a structure has objectid = rboberobjektid
Example:
start = aera x (rbobjekteid=111,rboberobjektid=111)
building a in aera x (rbobjekteid=4711,rboberobjektid = 111)
building b in aera x (rbobjekteid=4813,rboberobjektid = 111)
building c in aera x (rbobjekteid=4333,rboberobjektid = 111)
floor 1 in building a (rbobjekteid=5711,rboberobjektid = 4711)
floor 2 in building a (rbobjekteid=6711,rboberobjektid = 4711)
floor 3 in building a (rbobjekteid=5731,rboberobjektid = 4711)
floor 1 in building b (rbobjekteid=35711,rboberobjektid = 4813)
floor 2 in building a (rbobjekteid=6711,rboberobjektid = 4813)
room a in floor 1 of building a (rbobjekteid=46711,rboberobjektid = 5711)
....
I have an application that shows strucured customer data in a treeview All objects are treeview nodes that you can expand or shrink
Table objects holds 1500000 records
Table services holds 80000000 records
and both are still growing
To resolve a customer aera(l_startobjekt) we use the following comand via odbs against a maxdb database
l_cmd = "DECLARE RNAME CURSOR FOR WITH RECURSIVE TMPOBJ " +;
"(LEVEL, rbobjekteid, oberobjektid) " +;
" AS (SELECT 1, ro.rbobjekteid, ro.oberobjektid " +;
" FROM rbobjekte ro " +;
" WHERE oberobjektid = ?l_startobjekt "+;
" UNION ALL SELECT TMPOBJ.LEVEL + 1, ro.rbobjekteid, ro.oberobjektid
" FROM rbobjekte ro , tmpobj " +;
" WHERE ro.oberobjektid = TMPOBJ.rbobjekteid)"+;
" SELECT tmpobj.* FROM TMPOBJ order by tmpobj.level,tmpobj.rbobjekteid"
DO p_sqlcmd IN p_funktionen WITH p_verbindungsnr,l_cmd,(thisform.l_cursor)
(8000 objects in 1 second !!!)
We have a similar table in foxpro (9.0) and i don't know, how to do the resolving in foxpro (same performance ??)
Any help or ideas welcomed
Best regards
Albert
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only