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

Thread: Default Value

  1. #1
    Join Date
    Dec 2000
    Posts
    87
    Hi, all


    I tried to modify a column which would have sysdate as the default value, it worked as I enter:

    alter table xxx
    modify(created default sysdate);

    But when I tried to modify a column so that it would accept the current login user as a default value, it didn't work.
    This column has a datatype and size varchar2(16). I entered:

    alter table xxx
    modify(createdby default USER);

    I'm getting an error:
    ORA-01401 Inserted value too large for column.

    So what's the right way to do it?
    Thanks.

  2. #2
    Join Date
    Feb 2001
    Posts
    184
    You have the length of that Column less than that is required. To use the PseudoColumn of USer, The length should not be less than 30

    For this Statement to succeed
    alter table xxx
    modify(createdby default USER);

    Modify length of createdby to Varchar2(30)

    You be fine.. Thanks


  3. #3
    Join Date
    Dec 2000
    Posts
    87
    Thanks a lot, it worked.

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