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: Help : Converting Dates to Chars

Re: Help : Converting Dates to Chars

From: <mhr_at_NOSPAMramboll-it.dk>
Date: Mon, 18 Sep 2000 13:04:31 +0200
Message-ID: <39C5F6BF.689370EC@NOSPAMramboll-it.dk>

Hi,

One way is to change the default date format in order to produce the formatting of dates that you want. This could be done within your session and thereby avoiding influencing other users/applications conencted to the database. In SQL*PLUS the default date format is change with for example:

(c:\tmp) SQL> alter session set nls_date_format = 'dd-mm-yyyy hh24:mi:ss';

Session altered.

(c:\tmp) SQL> select sysdate from dual;

SYSDATE



18-09-2000 13:15:20

(c:\tmp) SQL>

Hope this helps!

rezaferry_at_my-deja.com wrote:

> I have an SQL statement which goes
> select * from <table>
> I use this same statement to get the data from each table. The problem
> is when I encounter a Date field I only get the date and not the time,
> while I need both the date and the time data.
>
> Eg : If I have a data 9-01-2000, 12:50 it only shows 9-01-2000. How do
> I change the settings so that oracle automatically shows 9-01-2000.
> 12:50.
>
> And since I use it on different tables, I have no efficient way of
> knowing the name and the types of each field before hand. Thus I cannot
> just use to_char (D_SOMETHING, 'DD-MM.......').
>
> Thanks ....
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Sep 18 2000 - 06:04:31 CDT

Original text of this message

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