Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Creating an view that updates related tables
you need to alias one of the columns in order to create the view. the easiest way is using the AS keyword followed by the name the column will be known by in the view. e.g.
create or replace view my_view
as
select x.id1 , x.my_col , y.my_col As y_my_col
btw... oracle will raise an exception if you attempt an insert into a view that is "non-key preserved".
"Jeff Boyer" <jdboyer@(remove)icomproductions.ca> wrote in message
news:94psu9$gp6$1_at_news3.cadvision.com...
> Hello,
>
> Can someone tell me how to create a view of two related tables so I can
> Insert data into these tables at once. I have tried to make a view that
> joins two related tables but since I am Insetring into this view, I would
> assume that I have to have the Primary key from the parent table and the
> forigen key from the child table so I can insert data into each field.
> Oracle is telling me I have dupliacte coumns even though I am defining
them
> as table1.field and table2.field. Can anyone help?
>
>
>
Received on Sun Jan 28 2001 - 23:50:33 CST