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

Home -> Community -> Usenet -> c.d.o.server -> Re: Remove default value from table definition

Re: Remove default value from table definition

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Tue, 17 Jan 2006 22:26:28 +0000
Message-ID: <6crqs19j0edicdlhcqkcku491ppe04r60g@4ax.com>


On Tue, 17 Jan 2006 13:49:15 -0800, DA Morgan <damorgan_at_psoug.org> wrote:

>Walt wrote:
>
>> Looks like your demo shows how to set the default value to NULL.
>>
>> I'm not that this is a distinction with a difference, but the OP seems
>> to think it is.
>
>Setting it to NULL is removing it. NULL is the default. That is what it
>is on all Oracle tables all the time. If the user doesn't provide a
>value then the column, by default, is NULL.

 You're entirely right in saying there's no obvious functional difference.

 But the OP seems to want to remove the final bit of visible difference :-

SQL> create table t (c number);

Table created.

SQL> select data_default
  2 from user_tab_columns
  3 where table_name = 'T'
  4 and column_name = 'C';

DATA_DEFAULT


SQL> alter table t modify c default 0;

Table altered.

SQL> select data_default
  2 from user_tab_columns
  3 where table_name = 'T'
  4 and column_name = 'C';

DATA_DEFAULT



0

SQL> alter table t modify c default null;

Table altered.

SQL> select data_default
  2 from user_tab_columns
  3 where table_name = 'T'
  4 and column_name = 'C';

DATA_DEFAULT



null

 It's an apparently harmless anomaly, but presumably rails against the OP's sense of neatness.

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Tue Jan 17 2006 - 16:26:28 CST

Original text of this message

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