Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    7

    Red face Unanswered: Not Null To Null

    Hi All,


    I have one problem.
    We have created one table with not null constraint.
    Now I want to alter those columns back to null.
    I have fired following syntax but it's not happening...
    Can anybody help me out..

    1. ALTER TABLE test ALTER COLUMN age DROP NULL;
    2. ALTER TABLE test ALTER COLUMN age SET NULL;

    Plese reply ASAP.


    Regards,

    Bhushan Sawant
    Last edited by Bhushan_sawant; 11-21-03 at 03:04.

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780

    Re: Not Null To Null

    Originally posted by Bhushan_sawant
    Hi All,


    I have one problem.
    We have created one table with not null constraint.
    Now I want to alter those columns back to null.
    I have fired following syntax but it's not happening...
    Can anybody help me out..

    1. ALTER TABLE test ALTER COLUMN age DROP NULL;
    2. ALTER TABLE test ALTER COLUMN age SET NULL;

    Plese reply ASAP.


    Regards,

    Bhushan Sawant
    Hi,

    create table T1
    ( age date not null )

    alter table T1 modify age date null;

    Warning, not use DROP.

    Gustavo.

  3. #3
    Join Date
    Nov 2003
    Posts
    7
    Thanks Gustav,

    I could achive this by using following ...

    --------------------
    alter table test modify(function_id integer);
    --------------------
    1. Don't specify "null" by default it takes null.
    2. Specify "not null" to convert from null to not null.

    This is to share my experiance with others...

    Bhushan Sawant

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Originally posted by Bhushan_sawant
    Thanks Gustav,

    I could achive this by using following ...

    --------------------
    alter table test modify(function_id integer);
    --------------------
    1. Don't specify "null" by default it takes null.
    2. Specify "not null" to convert from null to not null.

    This is to share my experiance with others...

    Bhushan Sawant
    Hi Bhushan,

    Warning:
    If the table have constraint the sentence
    --------------------
    alter table test modify(function_id integer);
    --------------------
    lost them.

    Gustavo.

Posting Permissions

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