ORA-00001 : Unique Constraint Violated caused by DATE VS Timestamp(6)
Create table tt1 (
dt date primary key
);
Create table tt2(
dt timestamp(6) primary key
);
Insert into tt2 values('25-NOV-13 04.18.47.138746000 PM');
Insert into tt2 values('25-NOV-13 04.18.47.66 PM');
commit;
Insert into tt1 select * from tt2;
ORA-00001: unique constraint violated
unique constraint (%s.%s) violated"
This is because Oracle does not store fractional part for DATE data type. These 2 rows are considered duplicate in TT1. This issue could happen in data migration project if you had not noticed the difference between date and timestamp(6) data type.
dt date primary key
);
Create table tt2(
dt timestamp(6) primary key
);
Insert into tt2 values('25-NOV-13 04.18.47.138746000 PM');
Insert into tt2 values('25-NOV-13 04.18.47.66 PM');
commit;
Insert into tt1 select * from tt2;
ORA-00001: unique constraint violated
unique constraint (%s.%s) violated"
This is because Oracle does not store fractional part for DATE data type. These 2 rows are considered duplicate in TT1. This issue could happen in data migration project if you had not noticed the difference between date and timestamp(6) data type.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-1061070/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-00001 Unique Constraint SYS.I_JOB_JOB ViolatedAI
- ORA-00001: UNIQUE CONSTRAINT (SYS.WRI$_SQLSET_PLANS_PK) VIOLATEDAISQL
- ORA-00001: unique constraint (...) violated並不一定是資料衝突AI
- ORA-00001: unique constraint (PERFSTAT.STATS$SQL_SUMMARY_PK) violated 解決方法AISQL
- Bug 2784796: ORA-00001:UNIQUE CONSTRAINTAI
- :[IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-00001: unique constraint (SCIBMOracleProtocolAI
- Data Warehouse Guide閱讀筆記(六):unique constraint & unique indexGUIIDE筆記AIIndex
- date、timestamp欄位型別型別
- java convert timestamp to date and timeJava
- oracle timestamp轉換date及date型別相減Oracle型別
- Sparse Indexes vs unique indexIndex
- Oracle中Date和Timestamp的區別Oracle
- MySQL: datetime vs timestampMySql
- oracle plsql定義date_timestamp_with time zoneOracleSQL
- 將timestamp轉成date格式的指令碼指令碼
- ORA-02292: integrity constraint (xxxx) violated - child record foundAI
- date和timestamp型別之間的轉換型別
- String和Date、Timestamp之間的轉換
- JAVA裡的String、Timestamp、Date相互轉換Java
- 將timestamp型別轉換為date型別型別
- mysql資料庫date 、datetime、time、timestamp區別MySql資料庫
- ORACLE DATE型別和TIMESTAMP型別DUMP換算Oracle型別
- oracle資料型別date和timestamp的轉化Oracle資料型別
- Java:String和Date、Timestamp之間的轉換Java
- Mysql日期(DATE, TIME, DATETIME, TIMESTAMP)型別的比較MySql型別
- ORACLE DATE和TIMESTAMP資料型別的比較(一) (轉)Oracle資料型別
- ORACLE DATE和TIMESTAMP資料型別的比較(二) (轉)Oracle資料型別
- 6、TIMESTAMP WITH TIME ZONE和TIMESTAMP WITH LOCAL TIME ZONE的實踐理解
- Oracle timestamp型別轉換date格式指令碼(精確到秒)Oracle型別指令碼
- Bug 9290526 - Poor plan for recursive SQL used for DML involving a UNIQUE constraint [ID 9290526.8]SQLAI
- 面試題:能談談Date、Datetime、Time、Timestamp、year的區別嗎?面試題
- [20111229]date time timestamp? ansi liternals.txt
- mysql中的date、datetime、timestamp你還不知道怎麼使用嗎MySql
- [20230207]ANSI DATE and TIMESTAMP SQL syntax.txtSQL
- oracle中date資料型別與timestamp資料型別的轉換Oracle資料型別
- (轉)PLS_INTEGER型別與timestamp型別、date、及時間函式型別函式
- oracle將表中date資料型別修改為timestamp資料型別Oracle資料型別
- python date 和 datetime 的取值範圍(對比 Mysql 的 datetime 和 timestamp)PythonMySql