Home » SQL & PL/SQL » SQL & PL/SQL » default value and not null constraint (Oracle 8, 9,10)
default value and not null constraint [message #358355] Mon, 10 November 2008 19:39 Go to next message
Arthur6
Messages: 1
Registered: November 2008
Location: Germany
Junior Member
Does default value of a table column automatically implies not null constraint of this column?

I know an answer. An opinion of my chef (oracle certified DBA) concerning this simple question is exactly the opposite one.
Therefore I need more than one answer. Thank you.
Re: default value and not null constraint [message #358357 is a reply to message #358355] Mon, 10 November 2008 20:49 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
hi,

may be my english is very poor to understand your querry. anyway i guess something and replying. unless you create constraint as not null, columns will accept null.
yours
dr.s.raghunathan
Re: default value and not null constraint [message #358381 is a reply to message #358355] Tue, 11 November 2008 01:24 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maybe you could try.
SQL> create table t (col integer default 0);

Table created.

SQL> insert into t values (null);

1 row created.

SQL> select col from t;
       COL
----------


1 row selected.

Regards
Michel
Previous Topic: Query output - Help
Next Topic: REGEXP_LIKE function
Goto Forum:
  


Current Time: Mon Dec 05 15:00:18 CST 2016

Total time taken to generate the page: 0.08450 seconds