Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Argentina
    Posts
    26

    Question Unanswered: Error adding a column with a default value

    Hi,

    I'm trying to add a new column (named State) to a table (named NPublic); I'm using this command:

    ALTER TABLE NPublic ADD State RAW(16) DEFAULT HEXTORAW('0F0F0F0FFFFF1000FF00FF00FF00FF00');

    When I run it I get ORA-20001 error, without any description.

    Is this a valid way of doing this? Is there another way? I found that if I add it without the DEFAULT, it works OK. I'm using 8.1.7 version.
    I would really appreciate your answers,

    Thanks,

    Federico

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    works for me on 8172
    PHP Code:
    SQL*PlusRelease 8.1.7.0.0 Production on Thu Jan 6 15:00:14 2005

    (cCopyright 2000 Oracle Corporation.  All rights reserved.


    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.2.0 Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 
    Production

     
    create table npublic (test1 varchar2(20));

    Table created.

     > 
    ALTER TABLE NPublic ADD State RAW(16
    DEFAULT 
    HEXTORAW('0F0F0F0FFFFF1000FF00FF00FF00FF00');

    Table altered
    Last edited by The_Duck; 01-06-05 at 11:10.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Feb 2004
    Location
    Argentina
    Posts
    26
    Yes, it's strange


    SQL*Plus: Release 8.1.7.0.0 - Production on Jue Ene 6 12:14:21 2005

    (c) Copyright 2000 Oracle Corporation. All rights reserved.


    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - Production

    SQL> ALTER TABLE NPUBLIC ADD State RAW(16) DEFAULT HEXTORAW('0F0F0F0FFFFF1000FF00FF00FF00FF00');
    ALTER TABLE NPUBLIC ADD State RAW(16) DEFAULT HEXTORAW('0F0F0F0FFFFF1000FF00FF00FF00FF00')
    *
    ERROR at line 1:
    ORA-20001:


    SQL>

    Anyways, I found that if I first add the column and then modify it, it works OK.

    Thanks!

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    that was going to be my next suggestion
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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