Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136

    Unanswered: To define default-value for existing column

    Hello!

    e.g.:

    table x
    ==================
    column_a integer,
    column_b varchar2(10),
    ...
    ==================

    Now i want to define a default-value for column b 'TEST'.

    How can i do it?

    (
    alter table X add (COLUMN_B varchar2(10) default 'TEST');
    -> doesn't function, because column_b already exists.
    )
    Regards,
    Julia

  2. #2
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    Code:
    alter table X modify (COLUMN_B varchar2(10) default 'TEST');
    FYI : http://download-west.oracle.com/docs...bles.htm#20763

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: To define default-value for existing column

    alter table X modify (column_b default 'TEST');

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    136
    Thank You!

    It also functions without datatype:

    alter table X modify (COLUMN_B default 'TEST');
    Regards,
    Julia

Posting Permissions

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