Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Urgent -How to save not latin dates?

Re: Urgent -How to save not latin dates?

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: Mon, 25 Jul 2005 16:36:12 +0000 (UTC)
Message-ID: <dc34ds$5gt$3@klatschtante.init7.net>


> 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



18 Jamada El Thaniah 1426
08 Jamada El Thaniah 1426
28 Jamada El Thaniah 1426
07 Jamada El Thaniah 1425

hth
Rene

-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
Received on Mon Jul 25 2005 - 11:36:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US