Why Unique Constraint Violation Takes Place In Oracle? How This Problen Can Be Solved?
Unique Constraint Violation
Collapse
X
-
Originally posted by trinanjanWhy Unique Constraint Violation Takes Place In Oracle? How This Problen Can Be Solved?
Welcome to TSDN!!
Please make sure you follow POSTING GUIDELINES every time you post in this forum
Thanks
MODERATOR -
Originally posted by trinanjanWhy Unique Constraint Violation Takes Place In Oracle? How This Problen Can Be Solved?
Check this:
[code=oracle]
SQL> create table abcd(a NUMBER UNIQUE);
Table created.
SQL> insert into abcd values(1);
1 row created.
SQL> /
insert into abcd values(1)
*
ERROR at line 1:
ORA-00001: unique constraint (APPS.SYS_C0015 7910) violated
SQL> ed
Wrote file afiedt.buf
1* insert into abcd values(NULL)
SQL> /
1 row created.
SQL> /
1 row created.
SQL> /
1 row created.
SQL>
[/code]
Any number of NULLS can be inserted but not the same value.Comment
-
Originally posted by trinanjanWhy Unique Constraint Violation Takes Place In Oracle? How This Problen Can Be Solved?
To solve this u need to check for existance of data in a unique / Primay key field before inserting or updating the records.Comment
Comment