Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> view and null problem
Hi,
I have problem in creating a view of 2 tables which has not the same
columns.
sql>desc table1;
column datatype
name varchar2(10) age number sql>desc table2; column datatype
---------------------
name varchar2(10) rank varchar2(15) salary number
And then I create a view like this,it's ok.(I think it's ok because rank
is varchar2)
sql>create view person_view as
select name,null rank from table1
union all select name,rank from table2;
But then I create a view of 2 table by union of all column. sql>create view person_view as
select name,age,null rank,null salary from table1 union all select name,null age,rank,salary from table2;
It's error that->Expression must have same datatype as corresponding
expression (I think it's error because column age and salary is number
so they're not allowed for null?) But I don't want age,salary value
which have not value in view be 0 too.
Thank.
Supat.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Sep 13 1999 - 01:08:35 CDT
![]() |
![]() |