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

Home -> Community -> Usenet -> c.d.o.tools -> Re: date format

Re: date format

From: Bastiaan Schaap <bschaap_at_desyde.nl>
Date: 2000/08/03
Message-ID: <newscache$8icpyf$d4k$1@lnews.actcom.co.il>#1/1

Hi Andreas,

As far as I know it's not possibly to apply implicit formatting to a date column within a table. The date dataformat is an Oracle primary type, and I think it's stored as the number of seconds past since ... (?). The only way to do this would be to store the date in column that has a custom type you created yourself. However I'd recommend to just let it sit in a date column, and format it upon retrieval. So instead of a SELECT date FROM.... you'd do a SELECT TO_CHAR(date, 'YYYY.MM.DD') FROM..... You could also create 3 number columns in the table, one for year, month and day respectively. Then you could do a SELECT year || '.' || month || '.' || day FROM..... It's a bit of a creative process ;-)

HTH, Bastiaan Schaap
Oracle web development,
Desyde BV - Baarn
http://www.desyde.nl/
tel. +31355411711

Andreas Lommel <him_lommel_at_t-online.de> wrote in message news:39881712.19300612_at_news.btx.dtag.de...
> How can I create a table with the date format YYYY.MM.DD ?
> drop table datest;
>
> create table datest
> (
> lfdnr number(7),
> datum date
> )
> tablespace data01
> storage
> (
> minextents 1
> maxextents unlimited
> )
> /
Received on Thu Aug 03 2000 - 00:00:00 CDT

Original text of this message

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