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

Home -> Community -> Usenet -> c.d.o.server -> Re: creating views with mulitple tables

Re: creating views with mulitple tables

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Sat, 21 Aug 1999 01:56:46 GMT
Message-ID: <37c30680.43886355@netnews.worldnet.att.net>


On Fri, 20 Aug 1999 16:42:05 -0400, Kenny <karosenb_at_erols.com> wrote:

>first, i am trying to create a view selecting from two tables. the
>column names are the same in both tables, and they are primary keys in
>the corresponding tables. my question is, if after i create the view,
>and then i insert, update, or delete from that view, will it flow down
>to the underlying tables?

Oracle may have relaxed the rules a bit regarding updateable views, but I don't think that you can update a view that joins two tables.

>secondly, i am having trouble with the syntax of the create view.

This should do what you want:

create view combo (

	cust_id, first_name,last_name, 
      cust_id2, first_name2,last_name,)
as select c.cust_id, c.first_name, c.last_name,
	p.cust_id,p.first_name,p.last_name
from customer c
	preference p

where c.cust_id = p.cust_id;

regards,

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Fri Aug 20 1999 - 20:56:46 CDT

Original text of this message

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