What is the data type of Null?

Showing Answers 1 - 34 of 34 Answers

Srinivas

  • Jun 2nd, 2006
 

What is the Data Type of NULL?

In Tech Speack, NULL is a age old concept of nothing. This is not true in case of oracle. Oracle treats NULL as character value of length of 0.

So, the default data type of NULL is a character data type and to prove it, we create a view on a null column with an alias a, and then describe it to see the datatype and length of the string. Here is the code.....

create view myview
as
select null a from dual;

describe myview;

The describe command shows that the column a has a data type of a varchar2(0).

So the Answer is : Character Type

Nagesh

  • Jun 5th, 2006
 

Adding to Prev comments Also Null is and undefined Value its not = 0  ' '  (Space) , also if Value of null may not be equal to Null (null!= null)(its an unknow value or not defined value.

  Was this answer useful?  Yes

Mohan Cherin

  • Jun 29th, 2006
 

Data type of NULL is any scalar variable i.e varchar2, char, number, date etc..

  Was this answer useful?  Yes

Girish Bhatia

  • Jul 18th, 2006
 

Adding to Srinivas comments,

NULL has same datatype as the column, so if we make view with the following query

create view myview
as
select to_date(null) a from dual;

describe myview;

then datatype of it will be DATE, same way we can use to_number() function instead os to_date and see the results.

  Was this answer useful?  Yes

Ritesh Ratna

  • Nov 3rd, 2006
 

NULL value is accepted by Fields that are Number Datatype also. So how can it be varchar. As varchar values can not be inserted in Field with Datatype  as Number.

  Was this answer useful?  Yes

RoulRaj

  • May 9th, 2007
 

Null may be any data type

  Was this answer useful?  Yes

g_sidhu

  • Feb 1st, 2008
 

A null value means the value is unav ailable, unassigned, unknown, or inapplicable. Therefore, you cannot test with = because a null cannot be equal or unequal to any value.

  Was this answer useful?  Yes

bhaskarreddy

  • Oct 1st, 2011
 

Null is the undefined value...
Null is never equal to zero..

  Was this answer useful?  Yes

Sandeep

  • Mar 7th, 2012
 

char(0)

  Was this answer useful?  Yes

rayavarapu

  • Jan 23rd, 2013
 

Null is not a value and not a string. It is unknown it is maximum in descending order and minimum value in ascending order.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions