Home » SQL & PL/SQL » SQL & PL/SQL » Can I define Date Format in Create Table Syntax (merged)
Can I define Date Format in Create Table Syntax (merged) [message #205552] Sat, 25 November 2006 21:36 Go to next message
dhanjit
Messages: 6
Registered: October 2006
Location: New Delhi
Junior Member
Hi All,

Can I define Date Format While Createing Table
I din't find answer
I know one can change date format while insert row in table
Ex-
CREATE TABLE TEST( ETNO NUMBER(3),ENAME VARCHAR2(10),HIREDATE DATE);

suppose default date format is mm/dd/yyyy but I want to change
here in create table statement

Thanks
Dhanjit
Re: Can I define Date Format in Create Table Syntax [message #205553 is a reply to message #205552] Sat, 25 November 2006 21:58 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
WRONG!
DATE is a data type; which is inherently without any format.
A date format ONLY applies to how/when it is presented & NOT how a DATE is stored.
Re: Can I define Date Format in Create Table Syntax [message #206204 is a reply to message #205553] Wed, 29 November 2006 03:28 Go to previous messageGo to next message
prabhakarkamath
Messages: 13
Registered: February 2006
Junior Member
Adding to above, if you want to change the way the date format is appearing, you can set at the session level using the following and later query the column.

ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD';

Cheers

Can I define Date Format in Create Table Syntax [message #212319 is a reply to message #205552] Thu, 04 January 2007 12:30 Go to previous messageGo to next message
dhanjit
Messages: 6
Registered: October 2006
Location: New Delhi
Junior Member
Hi

Is it possible to change date format at the time of creating table


I know I can change date format at the time of Insertion


but Can I define Date Format in Create Table Syntax


Thanks
Re: Can I define Date Format in Create Table Syntax [message #212324 is a reply to message #212319] Thu, 04 January 2007 12:48 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
Wow, what a bad memory you have since you asked the same question months ago. Hence, I have removed my answer and will consider removing my answer to your other questions since it looks like you are too lazy to find the answers for yourself.

http://www.orafaq.com/forum/m/205552/66800/#msg_205552

[Updated on: Thu, 04 January 2007 12:51]

Report message to a moderator

Re: Can I define Date Format in Create Table Syntax [message #212336 is a reply to message #212324] Thu, 04 January 2007 14:43 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Wow, what a good memory, Joy Division! ./fa/1587/0/
Previous Topic: Query Help... need some ideas
Next Topic: UNION ALL
Goto Forum:
  


Current Time: Sun Dec 11 00:42:44 CST 2016

Total time taken to generate the page: 0.18405 seconds