Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help me altering table defination

Re: Help me altering table defination

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 03 Jan 2000 06:04:07 -0500
Message-ID: <og017s0mcadia84qens6jvd0r6vq519i40@4ax.com>


A copy of this was sent to Norazman <norazman_at_ti.com> (if that email address didn't require changing) On Mon, 03 Jan 2000 10:12:17 +0800, you wrote:

>Hi,
>I have a table with one a date data type.
>Currently that field having a defaut of sysdate.
>
>Ie
> Create table x
>(mydate date default sysdate
>..
>..
>);
>
>Is there any easy way I can remove the default without having to
>re-create the table.
>Thanks.

Yes, alter the default value for that column from sysdate to NULL:

tkyte_at_8.0> create table x ( a int, mydate date default sysdate );

Table created.

tkyte_at_8.0>
tkyte_at_8.0> insert into x (a) values ( 1);

1 row created.

tkyte_at_8.0> alter table x modify mydate default NULL;

Table altered.

tkyte_at_8.0> insert into x (a) values (2);

1 row created.

tkyte_at_8.0> select * from x;

         A MYDATE

---------- --------------------
         1 03-jan-2000 06:07:05
         2


--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jan 03 2000 - 05:04:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US