Hi Chandrashekar,
you should avoid recursion for stuff like that, it will result in huge spool usage.
There are two common solutions for:
select cust, act1 as accnt from tab where act1 is not null
union all
select cust, act2 as accnt from tab where act2 is not null
union all
select cust, act3 as accnt from tab where act3 is not null
union all
...
or a cross join to a table with integers like:
select cust,
case x
when 1 then act1
when 2 then act2
when 3 then act3
...
end as accnt
from tab cross join
(select day_of_calendar as x from sys_calendar.calendar
where x between 1 and 15) as dt
Dieter
Hi Chandrashekar,
you should avoid recursion for stuff like that, it will result in huge spool usage.
There are two common solutions for:
or a cross join to a table with integers like:
Dieter