Friday, October 19, 2012

ORA-02275

This was tested on Oracle 11.2.0.2.7. While investigating something else today, I came across a new error message. It seems that you cannot have more than one referential integrity check between the same two columns. That's one less thing I need to worry about I suppose:

SQL> alter table t2
  2  add constraint check_number1
  3  foreign key (col1)
  4  references t1(col1)
  5  on delete cascade
  6  /
 
Table altered.
 
SQL> alter table t2
  2  add constraint check_number2
  3  foreign key (col1)
  4  references t1(col1)
  5  on delete cascade
  6  /
foreign key (col1)
*
ERROR at line 3:
ORA-02275: such a referential constraint already
exists in the table
 
SQL>

No comments: