If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How To Set Default DATE..

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 2
Wink How To Set Default DATE..

Hello, I am new here and wanted help with how to assign DATE a default value using SYSDATE function.

I have tried but its not working accordingly:

Code:
ALTER TABLE Deposit ADD FirstCreated DATE (SYSDATE);
Thanks
Vrutin
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,495
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Sep 2012
Posts: 18
Alter table ad add v_date date (default sysdate)
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 2
Hi,

You can use following code:

CREATE TABLE MY_TABLE
(
MY_DATE_FIELD DATE default sysdate NOT NULL
);

Thanks!

Last edited by Pat Phelan; 11-30-12 at 06:49. Reason: Removed commercial URL
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On