Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Arabic Hijrah Date

155609Mar 2 2003 — edited Dec 27 2006
Hi,

With the below Function to convert Gregorian Date to Arabic Hijri Date raises Error:

Select Get_Hdate('04/03/2003')
From Dual
/

ORA-01839: date not valid for month specified
ORA-06512: at "TEST.GET_HDATE", line 5
ORA-06512: at line 1

Function Get_Hdate(F_Date in Date) Return Varchar2 Is
V_date Varchar2(30);
Begin
Select To_char(F_Date, 'DD/MM/YYYY', 'nls_calendar = '''||'Arabic Hijrah''')
Into V_date
From Dual ;
Return V_date;
End Get_Hdate;


Select Get_Hdate('03/03/2003')
From Dual
/

GET_HDATE(
----------
29/12/1423

Works fine...


Am I missing something....

Best regards,

Mohammed Osman
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2007
Added on Mar 2 2003
3 comments
792 views