SQL: Update on Views question (SQL Newbie)

From: William Todd Featherston <wtfxston_at_netcom.com>
Date: Thu, 9 Dec 1993 23:19:29 GMT
Message-ID: <wtfxstonCHsJGI.2JJ_at_netcom.com>


I have two tables described like this:

Para Table                  Value Table

recnumber  number           recnumber  number
paracode   number           paracode   number
units      number           result     number
mdl        number           mass       number


I have created a view like this:

    create view dataview as select p.recnumber, p.paracode,       p.units, p.mdl, v.result, v.mass
    from paratable p, valuetable v
      where p.recnumber = v.recnumber and p.paracode = v.paracode;

**Note: There are multiple "Value table" rows related to each

        "Para Table" row.

I am able to query and view data in "dataview" fine but now I want to modify (update) a value in this view. I tried:     

    update dataview set mass = NULL where units != '1';

But I get the message "ORA-01732: data manipulation operation not legal on this view".

So my question is how sould I set up my "view" to allow me to modify data in it? If this is not possible how does one structure an update statement to modify a tables value based on a value in a related table?

Any help in this matter will be greatly appreciated! Todd F. Received on Fri Dec 10 1993 - 00:19:29 CET

Original text of this message