When I do the union like this, it works,
select a, b, c
from A
union
select d, e, to_number(NULL)
from B;
But when I put it inside a view:
create or replace view XXX AS
(select a, b, c
from A
union
select d, e, to_number(NULL)
from B; )
The view can be created, but when I did any select query, I got error message ORA-01790: expression must have same datatype as corresponding expression. I am sure the real data inside the view definitions works by itself, I have worked on it for over 10 hours, still didn't figure it out.
What's wrong with view?
thank you a million!
select a, b, c
from A
union
select d, e, to_number(NULL)
from B;
But when I put it inside a view:
create or replace view XXX AS
(select a, b, c
from A
union
select d, e, to_number(NULL)
from B; )
The view can be created, but when I did any select query, I got error message ORA-01790: expression must have same datatype as corresponding expression. I am sure the real data inside the view definitions works by itself, I have worked on it for over 10 hours, still didn't figure it out.
What's wrong with view?
thank you a million!