-
Problem with adding NOT NULL Constraint
Hi,
I am trying to add a column to the existing master table. I have suspended the activities and trying to add the DDL as follows:
The statement works fine if not using the 'NOT NULL' constraint. However when used the NOT null, I get the following message
SQL> begin
2 dbms_repcat.alter_master_repobject(
3 sname => '"GIMQA"',
4 ONAME => '"INVENTORY_MASTER"',
5 TYPE => 'TABLE',
6 ddl_text=> 'alter table gimqa.inventory_master modify (qty_pkg default 0)');
7 end;
8 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_repcat.alter_master_repobject(
3 sname => '"GIMQA"',
4 ONAME => '"INVENTORY_MASTER"',
5 TYPE => 'TABLE',
6 ddl_text=> 'alter table gimqa.inventory_master modify (qty_pkg not null)');
7 end;
8 /
begin
*
ERROR at line 1:
ORA-23318: a ddl failure has occurred
ORA-06512: at "SYS.DBMS_REPCAT_MAS", line 628
ORA-06512: at "SYS.DBMS_REPCAT", line 288
ORA-06512: at line 2
Could you please help me in solving this problem
Badrinath
There is always a better way to do the things.
-
The first statement did not populate the qty_pkg column with 0's, it just marked it as the default. You'll have to UPDATE the column to 0's before adding the constraint, or create the constraint as novalidate, or delete all data from the table before applying the constraint
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|