Reputation: 105
I have the below query from oracle query point of view is that I have created a constraint on table BOA_INVOICE as shown below
ALTER TABLE BOA_INVOICE ADD CONSTRAINT CK_INVOICE_SOURCE_SYSTEM CHECK ( SOURCE_SYSTEM IN ('PCE','PDS'));
Now this constraint is added successfully , but later on i want to modify same constraint add two values as shown below
ALTER TABLE BOA_INVOICE ADD CONSTRAINT CK_INVOICE_SOURCE_SYSTEM CHECK ( SOURCE_SYSTEM IN ('PCE','PDS','PER','AWE'));
Please advise what will be the query to achieve the same
Upvotes: 2
Views: 59
Reputation: 23361
You need to drop the constraint first and then create it again.
ALTER TABLE BOA_INVOICE DROP CONSTRAINT CK_INVOICE_SOURCE_SYSTEM;
Then Create it again:
ALTER TABLE BOA_INVOICE ADD CONSTRAINT
CK_INVOICE_SOURCE_SYSTEM CHECK ( SOURCE_SYSTEM IN ('PCE','PDS','PER','AWE'));
Upvotes: 5