Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help : Converting Dates to Chars
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
(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
![]() |
![]() |