Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
deviant69
Starting Member
7 Posts |
Posted - 2004-06-25 : 09:35:17
|
| Hi,i develop a MaxDB. i work with the Nested Set Model and my question is, does anybody know if it is possible to move nodes inside this Nested Set Model, and if it is possible, if there is an example.thanks in advicedeviant69 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-06-25 : 09:55:39
|
| little more info on your model... table layout, sample data, and result example would be greatCorey |
 |
|
|
deviant69
Starting Member
7 Posts |
Posted - 2004-06-25 : 10:04:44
|
| the table just has 3 columns:NAME VARCHAR(10) | LEFT INTEGER | RIGHT INTEGERi load the table into a treeview and now i wanna move a node:NAME | LEFT | RIGHTRoot | 1 | 81 | 2 | 32 | 4 | 53 | 6 | 7now i wanna move 3 in 1, the result should be:NAME | LEFT | RIGHTRoot | 1 | 81 | 2 | 53 | 3 | 42 | 6 | 7this is a simple sample, but it shows how difficulte it is.at the moment i am able to move 2 in 1, but if i try 3 in 1, i get wrong values and the tree is destroyeddeviant69 |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-06-25 : 11:05:26
|
| I don't understand your tree. Are the left and right two branches? If so, then the result you want is a disconnected tree as there is no relationship from 5 to anything else.Maybe this will be of some help:http://www.seventhnight.com/treestructs.aspCorey |
 |
|
|
deviant69
Starting Member
7 Posts |
Posted - 2004-06-25 : 12:38:43
|
| i made a little example:[url]http://mitglied.lycos.de/westy69/tree.jpg[/url]i heard, that in Joe Celko's book: SQL for Smarties is a solution. he realeased many columns, so i thought one could have a solution, but i was wrong. so i tried to find a solution by myself, but that became little harder than i thought.deviant69 |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-06-25 : 12:46:38
|
| Take a look at the link i sent you... it should cover what you need to do to manage a tree.One problem I see with your currect example, is that you don't seem to managing the relationships between each name instance.Corey |
 |
|
|
deviant69
Starting Member
7 Posts |
Posted - 2004-06-28 : 06:21:42
|
like is said, it was just a sample. i handle much more information, but they are not important for the example.your link is not exactly what i was looking for, it is not a mutli parent tree, but finally i found a solution myself. thanks for your tips deviant69 |
 |
|
|
|
|
|
|
|