Frage

I got an ORA-00001: unique constraint error when I executed a procedure. I checked the table name and it has four primary keys. (a.sr_date, a.int_key, b.cli_no, b.act_no) from table1 a, table2 b I would like to know how I'm going to check the source tables so I would know what are the data that is causing the problem. Appreciate any help. Thank you.

War es hilfreich?

Lösung

If you going to insert data to table1, table2 from another SOURCE table, you can join or union your src and target tables, counting for equal fields.

Please put here desc of all tables involved;

Select count(1), f1, f2, f3 FROM <tables> GROUP BY f1, f2, f3 HAVING count(*) > 1;

will give your duplicated values.

Andere Tipps

My guess is that you failed to read the complete error message. According to Oracle documentation, the error text has the following format:

ORA-00001: unique constraint (string.string) violated

... where string.string will likely contain the name of the exact constant that's been violated.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top