Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Remove default value from table definition
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
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
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 toolReceived on Tue Jan 17 2006 - 16:26:28 CST
![]() |
![]() |