Subject Return Value from Depth of recursive SP
Author mnavahan
i have two table TREE-struct and Data-table

TREE-struct have struct of my tree
Data Table show value of mystuct. the data-table on filed tree-link
have
foreign key to tree-struct-id
i need have sum of value of tree from sub to root ans need result
level by
level wih any depth of tree-struct

TREE-struct
==========================
id parent
1 -1
2 1
3 1
7 3
8 3
9 2
10 2
11 3


Data-Table
==========================
id tree-link value
1 9 5
2 10 7
3 7 20
4 10 5
5 11 50
6 7 15


|9
|-2-|10
1-|
| |-7
|-3-|-8
|-11


in up eaxmple Result Table must Return the same as below :


SP_TREE-result
==========================
id parent sum


1 -1 97
2 1 17
3 1 80
7 6 35
8 6 0
9 5 5
10 5 12
11 6 50

is not hard by use recursive stored procedure .
but one big prolem : can not recursive procedure in depth return
value to
user (is true)?
useing new table for write result to this not nice beacuse my table
db is
multi user

what waty to do it ?