*
The moose likes Oracle/OAS and the fly likes Check Constraints Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Check Constraints" Watch "Check Constraints" New topic
Author

Check Constraints

Han You
Greenhorn

Joined: Oct 26, 2003
Posts: 25
Is there any way to modify an existing CHECK constraint on a table without doing a drop and add? I am interested in this for both 9i and 10g. Thanks to anyone that has an answer in advance.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37936
    
  22
Don't know. I Googled and found this, whihc suggests you can't alter a constraint.
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
can alter table to add constraint, for example:

ALTER TABLE table_name
ADD (CONSTRAINT constr_name CHECK ( yes_no_col_name IN ('N', 'Y')))
Hemavathy Ramamoorthy Gopal
Greenhorn

Joined: May 13, 2008
Posts: 17
Hi,

In oracle modifying exsiting constraints without dropping it is not possible. Always this two steps need to be followed Step 1 : Drop the constraints if exist. Step 2 : Add the constraints.


Regards,
Hema_RG
Han You
Greenhorn

Joined: Oct 26, 2003
Posts: 25
Ok, thanks for the feedback. My suspicion of not being able to modify constraints was confirmed. Good to know.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Check Constraints
 
Similar Threads
Spring:bind tag for multiple objects
WA #1.....word association
when static initialization occurs
need your opinion on JavaRanch sending you e-mail
a game