Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null in a Number Field

Status
Not open for further replies.

jeepxo

Programmer
Oct 1, 2002
228
0
0
CA
In MS SQL I can define a column as a numeric and still use "null" as a value.

Is there a way to do this in Oracle? From what I have seen from the NUMBER data type I have to put a numeric value in and can't use a null

To build may have to be the slow laborious task of years. To destroy can simply be the thoughtless act of a single day.
 
Hi,
As long as the NOT NULL constraint is not on the field, NULL should be a valid value...


Can you post the results of a DESC TABLENAME ?





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Also, just as in SQL Server, the table may have been defined as allowing nulls, but a separate constraint may have been added after the table was created. Don't forget to check that there isn't a user constraint lurking somewhere in the undergrowth.....

Regards

T
 
...And as a proof of concept for what Turkbear and Tharg are saying:
Code:
SQL> create table jeepxo (x number);

Table created.

SQL> insert into jeepxo values (null);

1 row created.

SQL> insert into jeepxo values (1);

1 row created.

SQL> select * from jeepxo;

         X
----------

         1

2 rows selected.
Notice 2 rows selected, of which one row's value is NULL.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top