Ok this is a similar problem like the one I had before but it has the requirment that it needs to be a view with 1 variable and it needs to be as simple as possible.
I need a view that generates a list of dates within a given month (that is the variable).
Here is what I have so far:
create view monthview(datesetter) as (
select
to_date(to_date(datesetter),'MM.YYYY')-1 + level as DateRange
from
dual
where
(to_date(to_date(datesetter),'MM.YYYY')-1+level) <= sysdate
connect by level<=31);
and the view should than be called by something like:
select * from monthview where datesetter='02.2008';
and then generate a list like
01.02.2007
02.02.2007
and so on
It either tells me that I can’t compile the view due to the fact that there is a mistake when I use datesetter or it compiles the view but then it tells me thata there is a non numeric value where a numeric one is needed when I use ‘datesetter’ ….
Thanks for any ideas or help
try a pipelined function:
Now you can use it like this:
Here is a fiddle