Re: Creating Views

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Mon, 23 Aug 1999 08:15:32 -0400
Message-ID: <37C13B63.C1083F72_at_Unforgettable.com>


Kenny wrote:

> Hey all,
>
> Two part question:
>
> First, I am trying to create a view that joins two tables, both tables
> having the same primary key. After creating the view, if I then insert,
> update, or delete a record from that view, will it affect both tables?
>
> Second, Can someone tell me the syntax of joining two tables in the
> create view statement.
>
> I know its something like:
>
> create view combo as select cust_id, first_name, last_name from customer
> ( here is the part where I want to also select cust_id, first_name,
> last_name from another table called preferences)

You cannot insert into a view that is defined with a join.

The syntax for creating a view containing a join is exactly the same syntax as entering a sql statement which contains a join except that it would be preceded with:

create or replace view myview as
select ......
etc.

Ken Received on Mon Aug 23 1999 - 14:15:32 CEST

Original text of this message