-
add constraint problem
Hi,
I am trying to add constraint, and getting this error.
SQL> alter table ap6.ap_invoices_all
add constraint up_inv_num check(invoice_num = upper invoice_num));
ERROR at line 2:
ORA-02293: cannot enable (AP6.UP_INV_NUM) - check constraint violated
Hintts- The table is already populated. Is this could be the reason?
Thanks in advance.
-
Does your data meet the constraint requirement? If not you will need to create the constraint with the DISABLE option
Code:
ALTER TABLE ap6.ap_invoices_all
ADD CONSTRAINT
up_inv_num CHECK(invoice_num = UPPER(invoice_num)) DISABLE;
HTH
-
hey check ur code
u have missed a (
it should be upper(invoice_num)
and not invoice_num=upper invoice_num));
HTH
SS