top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Oracle: If a unique key constraint on DATE column is created, will it validate the rows that are inserted with sysdate?

+2 votes
1,179 views
Oracle: If a unique key constraint on DATE column is created, will it validate the rows that are inserted with sysdate?
posted Aug 21, 2015 by Kunal Kapoor

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes
 
Best answer

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

answer Aug 31, 2015 by Arun Gowda
0 votes

UNIQUE CONSTARINT CAN VALIDATE PSEUDOCLOUMN SYSDATE

SYSDATE FORMAT IS LIKE 3/2/2010 8:42:46 PM

SO FOR EACH MILLISECOND IF U INSER A ROW IT WILL TAKE THE INSERTION BUT IF U INSERT IN EACH FRACTION OF MILLISECOND ITS VALIDATE AND UNIQUE CONSTARINT IS VOILATED.

or

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.

answer Aug 24, 2015 by Manikandan J
It won't, Because SYSDATE format contains time attached with it.
Similar Questions
+1 vote

I am using below statement but i got error.
ALTER TABLE XXXtable
ADD xxx_name varchar2(50) not null;

error message:
ORA-01758: table must be empty to add mandatory (NOT NULL) column

+1 vote

In SQL Server, Unique Key Constraint will allow only one NULL value. But there are situations that are more than one null value in the column, but still have to maintain Uniqueness by ignoring all null values.

...