Start a new topic

(Check) Constraint editing: modifying instead of drop/create

Hej


I noticed that is not possible to modify a (check) constraint - I did not try others for now. To me this is a bit cumbersome for I have to drop and create a constraint actually in order to modify it. I do no mind at all, however, if the generated code in the background is a drop and create.


Kind regards


Thiemo


Hi Thiemo,


I guess you are meaning that the following statement is generated


alter table t drop constraint ck ;
alter table t add constraint ck check (n < 0) enable novalidate;


What database are you using? From what I can see not many databases are supporting altering a constraint. The above example is from Oracle.


Kind Regards


Ulf

Hej Ulf


Perfectly right, in both. I used both Oracle there and also about the generated statement. Personally, I do not care about running an alter statement or a combination of drop create as long as the result stays the same. I imagine, for you, it is better to have to handle as little DB specialties as possible.


Kind regards


Thiemo

Login or Signup to post a comment