Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating Views
Hi Kenny,
The syntax for creating such a view is:
create view xxx as select a.cust_id, a.first_name, a.last_name,
b.loves_children
from customer a, preferences b where <here goes join condition>;
If columns names coincide, use qualifiers, like a.name newname. When you
create
such a view, you may not be able to do all the operations against it,
because there
is a number of restrictions. And I doubt it that Oracle will ever update two
underlying
tables. See the manual and make sure you understand all the implications of
modifying thru a view. And, it's really more easy to modify the base tables
directly.
Regards,
Karen Abgarian.
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)
>
> Any info would be great..
> Regards
> -Kenny
>
> p.s. please respond to my email
> karosenb_at_erols.com
Received on Fri Aug 20 1999 - 16:22:06 CDT