Click to See Complete Forum and Search --> : add constraint problem


aph
05-12-2003, 12:39 PM
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.

jovery
05-12-2003, 12:46 PM
Does your data meet the constraint requirement? If not you will need to create the constraint with the DISABLE option


ALTER TABLE ap6.ap_invoices_all
ADD CONSTRAINT
up_inv_num CHECK(invoice_num = UPPER(invoice_num)) DISABLE;


HTH

Srinivas_Sharma
05-12-2003, 12:50 PM
hey check ur code

u have missed a (

it should be upper(invoice_num)

and not invoice_num=upper invoice_num));

HTH

SS