You Asked
Tom
What is the difference between "select null from dual" and "select to_number(null) from dual"
Is it only a semantic meaning or does SQL allocate a variable of number datatype for the to_number one?
and Tom said...
one selects NULL and will be of type "string"
the other selects NULL and will be of type "number"
ops$tkyte%ORA10GR2> create or replace view vw as select null x, to_number(null) y from dual;
View created.
ops$tkyte%ORA10GR2> desc vw
Name Null? Type
---------------------------------------- -------- ----------------------------
X VARCHAR2
Y NUMBER
Rating
(2 ratings)
Is this answer out of date? If it is, please let us know via a Comment