2

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

1
  • Hi there. Please, if the given answer solves your problem consider in accepting it. Just click on the V icon on the left on the answer. Commented May 26, 2016 at 21:54

1 Answer 1

5

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'));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.