Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Urgent -How to save not latin dates?
> Hi there,
> Is there anybody knows how can I save not latin dates in Oracle? I
> mean for example: Jalali(shamsi) calender or Arabic Calender(Hijri)
> instead of using Julian Calendar.
> Currently we do this by saving this dates in varchar type and another
> equivalent Latin datetime(e.g. 2 columns).We perform operations on
> Latin and then manipulate the varchar column and ofcourse application
> always will see this varchar column.
> -Thanks alot
A date is a date is a date, no matter in what culture/region/calender.
Therefore, the date datatype is totally sufficient to store a date.
Actually, storing dates as varchar2 (or any other type) is bad practice.
Consider:
create table some_dates (
the_date date
);
insert into some_dates values (sysdate); insert into some_dates values (sysdate-10); insert into some_dates values (sysdate+10); insert into some_dates values (sysdate-365);
select * from some_dates;
THE_DATE
25-JUL-05 15-JUL-05 04-AUG-05 25-JUL-04
alter session set nls_calendar = 'English Hijrah';
select * from some_dates;
THE_DATE
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Mon Jul 25 2005 - 11:36:12 CDT