If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE ?

It won't, Because SYSDATE format contains time attached with it.

Showing Answers 1 - 8 of 8 Answers

tarun1282

  • Apr 27th, 2006
 

if the rows are inserting on the same day with using sysdate then it wl not insert the rows because of unique constraint

  Was this answer useful?  Yes

ajay

  • Aug 1st, 2006
 

   Hi,

  If there is a unique key defined on a column which has date as the data type then one can insert the same date more than once.The date is always stored in the format dd-mon-yyyy hh:mi:ss.The reason why it will accept the same date again is that the time taken for you to enter the date for the first time and entering the date again for the second time there will be a gap of atleast one secon which makes that date value unique.     ONE CAN INSERT THE SAME DATE VALUE IN A UNIQUE COLUMN MORE  THAN ONCE.

  Was this answer useful?  Yes

Ashima Chhabra

  • Jun 19th, 2015
 

No...you can save a single row with the sysdate but not more than 1 on same date because format of date is YYYY-MM-DD and format of datetime is YYYY-MM-DD hh:mm:ss[.nnn] and format of smalldatetime is YYYY-MM-DD hh:mm:ss

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions