Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: view and null problem

Re: view and null problem

From: Doronin V <v_doronin_at_softhome.net>
Date: Mon, 13 Sep 1999 14:09:09 +0400
Message-ID: <7riiik$se8$1@pumba.class.udg.mx>


 sql>create view person_view as

     select name,age,null rank,to_number(null) salary from table1
     union all select name,to_number(null) age,rank,salary from table2;


--
Доронин Владимир
Аналитический центр "Жилище"

<su_pat_at_my-deja.com> сообщил в новостях следующее:7ri4cu$1kg$1_at_nnrp1.deja.com...
| 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 - 05:09:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US