very urgent...how to do looping inside a table [message #18913] |
Thu, 21 February 2002 00:26 |
ksr
Messages: 112 Registered: January 2002
|
Senior Member |
|
|
Hi,
I have a table called tab1(parent number,child number).
sample data
------------
parent child
1 2
1 3
2 4
2 5
4 6
4 7
3 8
3 9
Now i want to find out all the childs and their childs and their childs.
Suppose i want all the childs of parent 1 and then insert the data into a temporary table.
I will be passing a array of parent ids and it should search for all childs and their childs and fill the temporary table.
How can i do this either through sql or plsql.
i should get the data like
child
------
2
3
4
5
6
7
|
|
|
|