Wrote file afiedt.buf
1 Create Or Replace Function IsLeapYear(p_Date Date Default Sysdate) Return Number
2 As
3 retVal Number;
4 Begin
5 Select Decode(TO_NUMBER(TO_CHAR(LAST_DAY(Sysdate),'DD')),29,1,0) Into Retval From Dual;
6 Return retVal;
7* End;
SQL> /
Function created.
SQL> select IsLeapYear(Sysdate) from dual;
ISLEAPYEAR(SYSDATE)
-------------------
0
SQL>
HTH
Regards,
Ganesh R
Oracle LazyDBA home page