Home » SQL & PL/SQL » SQL & PL/SQL » date in table
date in table [message #1615] Thu, 16 May 2002 00:41 Go to next message
THA
Messages: 26
Registered: February 2002
Junior Member
is there any way of storing a date in a table in my specified format, say 'YYYY-DD-MON'? i.e. not in the default format as oracle specifies.
any help will be greately appreciated.
Re: date in table [message #1616 is a reply to message #1615] Thu, 16 May 2002 02:20 Go to previous messageGo to next message
THA
Messages: 26
Registered: February 2002
Junior Member
NLS_DATE_FORMAT should be changed. but how?
Re: date in table [message #1619 is a reply to message #1615] Thu, 16 May 2002 05:01 Go to previous messageGo to next message
John R
Messages: 156
Registered: March 2000
Senior Member
Oracle doesn't store dates in any specific format - they are stored as datatype 'DATE'.

You want to change the NLS_DATE_FORMAT in the oracle parameters file, and optionally change it on the client pcs as well.

This will only affect how the date is displayed - it will not affect the actual stored data.
Re: date in table [message #1626 is a reply to message #1615] Thu, 16 May 2002 10:32 Go to previous messageGo to next message
Jim Reed
Messages: 2
Registered: May 2002
Junior Member
Oracle date handling can be a real pain. If you can do it the easiest way is to use the Oracle function TO_DATE. This allows the user to enter in any format you choose. For example in your update SQL do this:

INSERT .... TO_DATE(MyDate, 'YYYY-DD-MON')

For most cases this is the way to go. Unfortunately for Dreamweaver UltraDev users this solution is not very easy to implement.
Re: date in table [message #1646 is a reply to message #1615] Fri, 17 May 2002 07:32 Go to previous message
THA
Messages: 26
Registered: February 2002
Junior Member
thnks for your reply.
Previous Topic: Oracle autonumber using sequence n trigger
Next Topic: to_char in a where clause
Goto Forum:
  


Current Time: Thu Mar 28 11:25:37 CDT 2024