Need help in recursive function

Not applicable

Need help in recursive function

Hi Team,

Table Name:tree_struct

Path ID Depth Tree_Path
1 5 3765|~5789|~4758|~8999|~2145|~2455
2 4 7869|~5864|~14523|~8933|~4256

The table tree_struct has above data. I need to parse the each values from Tree_Path column like below columns:


tree_path2:5789       ... etc according to the number from the Depth column.

For example if the Depth is 5 you will have 6 values in Tree_path column. So i need create 6 columns like Tree_path1,Tree_path2...Tree_path6.

is it possible using recursive function. And i need to store it into a volatile table.

Please help me

Thank You