Re: Update on VIEW

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Fri, 18 Feb 2000 18:52:04 +0800
Message-ID: <38AD2454.539E_at_yahoo.com>


Marian ZUREK wrote:
>
> Hi,
>
> When I wanted to perform update on a newly created view (whose component
> is also another view and table) I got error message as follows.
> -------------------------
> ORA-01779: cannot modify a column which maps to a non key-preserved table
> -------------------------
>
> I'd be grateful for any information, recommendation of reading, etc. which
> would allow me to execute update.
>
> Regards,
> Marian
>
> *********************************
> * Marian Zurek *
> * CERN *
> * CH-1211 GENEVE 23 *
> * e-mail: Marian.Zurek_at_cern.ch *
> *********************************

You can update views typically when:

  1. they are simple (one table, no grouping)
  2. they are joins where one of the tables is 'key preserved', ie, each row in the view equates to a row in that table and has the primary key available.
  3. you code an INSTEAD OF trigger (8.0+)

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

"Beta, n: Latin for 'still does not work'"
Received on Fri Feb 18 2000 - 11:52:04 CET

Original text of this message