what is the type of NULL
February 9th, 2010
7 comments
I was a bit surprised to see a VARCHAR2(0) column in my schema
select column_name, data_type, data_length
from user_tab_columns
where table_name='V';
COLUMN_NAME DATA_TYPE DATA_LENGTH
--------------- -------------------- -----------
X VARCHAR2 0
What’s this datatype? It is the datatype of NULL !!!
SQL> create or replace view v as select null x from dual
View created.
SQL> desc v
VIEW v
Name Null? Type
----------------- -------- ------------
X VARCHAR2(0)