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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dates - control how stored?

Re: Dates - control how stored?

From: Stephan Born <stephan.born_at_beusen.de>
Date: Thu, 23 Dec 1999 09:49:57 +0100
Message-ID: <3861E235.51531404@beusen.de>

hmerrill_at_my-deja.com schrieb:

>

> Mark, in sqlplus when I do a select of some test dates that I inserted,
> this is what is displayed:
>
> SQL> select * from TEST_DATES;
>
> DATE1 DATE2
> --------- ---------
> 08-DEC-99 12-DEC-99
> 12-AUG-99 01-DEC-99
>
> SQL>
>
> Can you alter the default format that DATE fields are retrieved in, or
> do you have to use TO_CHAR for every date in a SELECT if you want to
> change that default format?
>

Try

alter session
set NLS_DATE_FORMAT = '<format>';

Where <format> is the same format-string as in to_date / to_char

This statement will set the default-date-format in your current session

SQL> select sysdate from dual;

SYSDATE



23.12.99

SQL> alter session set NLS_DATE_FORMAT = 'DD. MON YYYY HH24:MI';

Sitzung wurde geõndert.

SQL> select sysdate from dual;

SYSDATE



23. DEZ 1999 09:48 SQL> Regards, stephan

--


Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-29          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------


Received on Thu Dec 23 1999 - 02:49:57 CST

Original text of this message

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