DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Problem with adding NOT NULL Constraint

  1. #1
    Join Date
    Jan 2001
    Posts
    642

    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.

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    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
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width