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: Removing a default value

Re: Removing a default value

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Tue, 29 Aug 2006 20:41:40 +0200
Message-ID: <44f48a66$0$10096$636a55ce@news.free.fr>

"Jens Lenge" <spampot_at_gmx.net> a écrit dans le message de news: 1156873876.870883.98560_at_i3g2000cwc.googlegroups.com...
| Michel Cadot wrote:
|
| > What is the difference between no default and default null?
| > When there is no default and you don't give a value to a field then
| > this field is null.
| > In Oracle, to remove a default value you set the default to null.
|
| At least Oracle SQL Developer seems to spot a difference:
| Columns with no default value are displayed with an empty field in the
| "Data Default" column, while columns that have explicitly been set (or
| modified) to "default null" are displayed with "null". Also, the
| automatically created DDL sequence for the respective table contains
| "DEFAULT NULL" in the latter case while it has no default statement at
| all in the first case.
|
| That's why I suspected that Oracle does make a difference between "no
| default" and "default to null". Or is it just a bug of SQL Developer?
|
| Jens
|

It's not a bug.
The difference is due to Oracle dictionary. When there is no default then default value is null in the dictionary. When it set to "null" then dictionary contains the string "null" which is not the same as a default value equals to the string 'null'. In this case the dictionary contains the string "'null'" (without the " but with the ').
But there is no *functional* difference between nothing the default value or a default of "null" (without any king of quote).

Regards
Michel Cadot Received on Tue Aug 29 2006 - 13:41:40 CDT

Original text of this message

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