Edit table bug : enable constaint

Ameen

Member²
Hi
I have a table with disabled constraints. When I use (Edit Table) window to enable one of those constraints with (novalidate) option, the result script is as follows:

-- Enable/Disable primary, unique and foreign key constraints
alter table ASSEMBLY_REPORTS
enable constraint SEMB_REP_PROD_CAT_FK;
-- Validate/Unvalidate primary, unique and foreign key constraints
alter table ASSEMBLY_REPORTS
modify constraint SEMB_REP_PROD_CAT_FK novalidate;

Where it must be as this:

alter table IMC.ASSEMBLY_REPORTS
modify constraint SEMB_REP_PROD_CAT_FK enable novalidate;

Note: if I use the (enable) with (validate) option the result script is correct and it is like this:

-- Enable/Disable primary, unique and foreign key constraints
alter table IMC.ASSEMBLY_REPORTS
enable constraint SEMB_REP_PROD_CAT_FK;

So the error exist when I uncheck (validated) check box (use novalidate option). The database refuses first line with error (ORA-00933: SQL command not properly ended) and the second line has no effect because the contraint still in (disabled) state.

 
Please note that if data is correct, the following script will be fine:

-- Enable/Disable primary, unique and foreign key constraints
alter table ASSEMBLY_REPORTS
enable constraint SEMB_REP_PROD_CAT_FK;
-- Validate/Unvalidate primary, unique and foreign key constraints
alter table ASSEMBLY_REPORTS
modify constraint SEMB_REP_PROD_CAT_FK novalidate;

but if I have corrupted data that prevent enabling the constraint at first time, then the script will fail, because first command will fail and the second wont have any effect as the constraint still in DISABLED state. So it must be like this:

alter table ASSEMBLY_REPORTS
modify constraint SEMB_REP_PROD_CAT_FK enable novalidate;
 
Back
Top