Get your CodeRanch badge!*
The moose likes Meaningless Drivel and the fly likes Oracle is Catholic! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Oracle is Catholic!" Watch "Oracle is Catholic!" New topic
Author

Oracle is Catholic!

SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
(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')))
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
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
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
Well, I wanted to leave it as an excercise for the reader.

COLUMN_VALUE
------------
10/1/1582
10/2/1582
10/3/1582
10/4/1582
10/15/1582
10/16/1582
10/17/1582
10/18/1582
10/19/1582
10/20/1582
10/21/1582
10/22/1582
10/23/1582
10/24/1582
10/25/1582
10/26/1582
10/27/1582
10/28/1582
10/29/1582
10/30/1582
10/31/1582
21 rows selected
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
found this link too..
http://www.geocities.com/calendopaedia/gregory.htm
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
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
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
yup thats what I get with cygwin cal on W2K.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle is Catholic!
 
Similar Threads
error in Oracle function
registerOutParameter Problem when the type is ARRAY
Oracle Pivot table
java.sql.SQLEx ception: Missing IN or OUT parameter at index:: 1
How to pass an Integer Array to a Stored Procedure in mysql?