![]() | |
#1
| |||
| |||
|
|
..... I have a list of items with children who have childern, etc, to a variable length, and I need a tree structure to be displayed. Using a cursor I get a list of top level items, then going through each record, I check for children for that item, and if a child exists, I call the sp, and the process continues. You can use recursive query rather than recursive sp or cursor. |
#2
| |||
| |||
|
|
Hi all Is there anyway to use a cursor in a sp that gets called recursivly? If I create a sp that calls itself and it has a cursor in it, it displays the error, "cursor already exists".(obviously) I have a list of items with children who have childern, etc, to a variable length, and I need a tree structure to be displayed. Using a cursor I get a list of top level items, then going through each record, I check for children for that item, and if a child exists, I call the sp, and the process continues. But of course it declares a cursor with the same name in the sp and it gives error. I don't know how many cursors I will need so it must be dynamic. So I thought I'd just pitch it to you guys, as I think it is impossible. |
![]() |
| Thread Tools | |
| Display Modes | |
| |