(from dbasupport.com) create or replace type tabDate as table of date /
create or replace function dates_in_month (p_month date) return tabDate pipelined is begin for i in 0 .. to_number(add_months(p_month,1)-p_month-1) loop pipe row (p_month+i); end loop; return; end; / select * from table (dates_in_month(to_date('01-oct-1582','DD-mon-YYYY')))
Well, for those of us who don't have a copy of Oracle lying around to test this on - what's the result? And is it any different from, say, what you'd get for an equivalent program using java.util.GregorianCalendar?
"I'm not back." - Bill Harding, Twister
Joined: Sep 28, 2001
Well, I wanted to leave it as an excercise for the reader.
What abt unix : At command prompt of any Unix ($), type : cal 9 1752 > Surprised??? > See the explanation for what you see. If you are not in Unix don't > worry: > see below: > September 1752 > S M Tu W Th F S > 1 2 14 15 16 > 17 18 19 20 21 22 23 > 24 25 26 27 28 29 30 > Isn't the output queer? A month with whole eleven days less? > This was the time England shifted from Roman Julian Calendar to the Gregorian Calendar, and the king of England ordered those 11 days to be wiped off the face of the month of September of 1752. (What couldn't a King do in those > days?!) > And yes, the workers worked for 11 days less, but got paid for the entire 30 days. And that's how "Paid Leave" was born. (Bless those people). > > Dont have unix so just believing what is written here.
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh